@@ -502,10 +502,10 @@ The following types can be pickled:
502
502
503
503
* tuples, lists, sets, and dictionaries containing only picklable objects;
504
504
505
- * functions (built-in and user-defined) defined at the top level of a module
506
- (using :keyword: `def `, not :keyword: `lambda `);
505
+ * functions (built-in and user-defined) accessible from the top level of a
506
+ module (using :keyword: `def `, not :keyword: `lambda `);
507
507
508
- * classes defined at the top level of a module;
508
+ * classes accessible from the top level of a module;
509
509
510
510
* instances of such classes whose the result of calling :meth: `__getstate__ `
511
511
is picklable (see section :ref: `pickle-inst ` for details).
@@ -517,9 +517,9 @@ structure may exceed the maximum recursion depth, a :exc:`RecursionError` will b
517
517
raised in this case. You can carefully raise this limit with
518
518
:func: `sys.setrecursionlimit `.
519
519
520
- Note that functions (built-in and user-defined) are pickled by fully qualified
521
- name, not by value. [# ]_ This means that only the function name is
522
- pickled, along with the name of the module the function is defined in . Neither
520
+ Note that functions (built-in and user-defined) are pickled by fully
521
+ :term: ` qualified name` , not by value. [# ]_ This means that only the function name is
522
+ pickled, along with the name of the containing module and classes . Neither
523
523
the function's code, nor any of its function attributes are pickled. Thus the
524
524
defining module must be importable in the unpickling environment, and the module
525
525
must contain the named object, otherwise an exception will be raised. [# ]_
0 commit comments