py2store.serializers.pickled¶
functions to pickle objects
-
py2store.serializers.pickled.
mk_marshal_rw_funcs
(**kwargs)[source]¶ Generates a reader and writer using marshal. That is, a pair of parametrized loads and dumps
>>> read, write = mk_marshal_rw_funcs() >>> d = {'a': 'simple', 'and': {'a': b'more', 'complex': [1, 2.2]}} >>> serialized_d = write(d) >>> deserialized_d = read(serialized_d) >>> assert d == deserialized_d
-
py2store.serializers.pickled.
mk_pickle_rw_funcs
(fix_imports=True, protocol=None, pickle_encoding='ASCII', pickle_errors='strict')[source]¶ Generates a reader and writer using pickle. That is, a pair of parametrized loads and dumps
>>> read, write = mk_pickle_rw_funcs() >>> d = {'a': 'simple', 'and': {'a': b'more', 'complex': [1, 2.2, dict]}} >>> serialized_d = write(d) >>> deserialized_d = read(serialized_d) >>> assert d == deserialized_d