@@ -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 :attr: `~object.__dict__ ` or the result of
511
511
calling :meth: `__getstate__ ` is picklable (see section :ref: `pickle-inst ` for
@@ -518,9 +518,9 @@ structure may exceed the maximum recursion depth, a :exc:`RecursionError` will b
518
518
raised in this case. You can carefully raise this limit with
519
519
:func: `sys.setrecursionlimit `.
520
520
521
- Note that functions (built-in and user-defined) are pickled by fully qualified
522
- name, not by value. [# ]_ This means that only the function name is
523
- pickled, along with the name of the module the function is defined in . Neither
521
+ Note that functions (built-in and user-defined) are pickled by fully
522
+ :term: ` qualified name` , not by value. [# ]_ This means that only the function name is
523
+ pickled, along with the name of the containing module and classes . Neither
524
524
the function's code, nor any of its function attributes are pickled. Thus the
525
525
defining module must be importable in the unpickling environment, and the module
526
526
must contain the named object, otherwise an exception will be raised. [# ]_
0 commit comments