#NEWLINE# @ classmethod #NEWLINE# def to_binary( cls , val , protocol_version ) : #NEWLINE# #INDENT# '\n        Serialize a value into a bytestring. See the serialize() method for\n        more information. This method differs in that if None is passed in,\n        the result is the empty string.\n        ' #NEWLINE# return ( b'' if ( val is None ) else cls . serialize ( cls , protocol_version ) )