From 1f2242650fbaf53fc03508189c8eee44c4f3823d Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Tue, 13 Jun 2023 23:39:19 +0800 Subject: [PATCH] ... --- docs/modules/pickle.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/modules/pickle.md b/docs/modules/pickle.md index 64474bb3..d243e052 100644 --- a/docs/modules/pickle.md +++ b/docs/modules/pickle.md @@ -11,3 +11,15 @@ Return the pickled representation of an object as a bytes object. Return the unpickled object from a bytes object. + +## What can be pickled and unpickled? + +The following types can be pickled: + +- [x] None, True, and False; +- [x] integers, floating-point numbers; +- [x] strings, bytes; +- [x] tuples, lists, sets, and dictionaries containing only picklable objects; +- [ ] functions (built-in and user-defined) accessible from the top level of a module (using def, not lambda); +- [ ] classes accessible from the top level of a module; +- [x] instances of such classes