(self, value)
return value
Returns a bytes representation of the given value, appropriate to be
        written to disk. The default implementation assumes a unicode value and
        encodes it using UTF-8.
Returns a bytes representation of the given value, appropriate to be
        written to disk. The default implementation assumes a unicode value and
        encodes it using UTF-8.
Returns a bytes representation of the given value appropriate to be written to disk . The default implementation assumes a unicode value and encodes it using UTF - 8 .
def to_bytes(self, value):
        """Returns a bytes representation of the given value, appropriate to be
        written to disk. The default implementation assumes a unicode value and
        encodes it using UTF-8.
        """

        if isinstance(value, (list, tuple)):
            value = value[0]
        if not isinstance(value, bytes_type):
            value = utf8encode(value)[0]
        return value
def to_bytes ( self , value ) : if isinstance ( value , ( list , tuple ) ) : value = value [ 0 ] if not isinstance ( value , bytes_type ) : value = utf8encode ( value ) [ 0 ] return value