mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-19 19:10:17 +00:00
781 B
781 B
icon | label |
---|---|
package | pickle |
pickle.dumps(obj) -> bytes
Return the pickled representation of an object as a bytes object.
pickle.loads(b: bytes)
Return the unpickled object from a bytes object.
What can be pickled and unpickled?
The following types can be pickled:
- None, True, and False;
- integers, floating-point numbers;
- strings, bytes;
- tuples, lists, sets, and dictionaries containing only picklable objects;
- functions (user-defined) accessible from the top level of a module (using def, not lambda);
- classes accessible from the top level of a module;
- instances of such classes
The following magic methods are available:
__getnewargs__
__getstate__
__setstate__
__reduce__