(self, obj: Any)
return value, value_type
Take a Python object and return it as a tuple (value, value_type), a
        blob and a one-char code for what type it is
Take a Python object and return it as a tuple (value, value_type), a
        blob and a one-char code for what type it is
Take a Python object and return it as a tuple ( value value_type ) a blob and a one - char code for what type it is
def encode(self, obj: Any) -> Tuple[Union[int, bytes], _EncodedKeyType]:
        """
        Take a Python object and return it as a tuple (value, value_type), a
        blob and a one-char code for what type it is
        """
        if self._is_valid_mysql_bigint(obj):
            return obj, "i"

        value = pickle.dumps(obj, pickle.HIGHEST_PROTOCOL)
        value_type: _EncodedKeyType = "p"
        if self._compress_min_length and len(value) >= self._compress_min_length:
            value = zlib.compress(value, self._compress_level)
            value_type = "z"
        return value, value_type
def encode ( self , obj : Any ) -> Tuple [ Union [ int , bytes ] , _EncodedKeyType ] : if self . _is_valid_mysql_bigint ( obj ) : return obj , "i" value = pickle . dumps ( obj , pickle . HIGHEST_PROTOCOL ) value_type : _EncodedKeyType = "p" if self . _compress_min_length and len ( value ) >= self . _compress_min_length : value = zlib . compress ( value , self . _compress_level ) value_type = "z" return value , value_type