Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2498d9e9
Commit
2498d9e9
authored
Oct 18, 2013
by
Ethan Furman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #19272: slight clarification of pickle docs with regard to lambda.
parent
63c141ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
Doc/library/pickle.rst
Doc/library/pickle.rst
+6
-2
No files found.
Doc/library/pickle.rst
View file @
2498d9e9
...
...
@@ -384,7 +384,8 @@ The following types can be pickled:
* tuples, lists, sets, and dictionaries containing only picklable objects
* functions defined at the top level of a module
* functions defined at the top level of a module (using :keyword:`def`, not
:keyword:`lambda`)
* built-in functions defined at the top level of a module
...
...
@@ -402,7 +403,7 @@ raised in this case. You can carefully raise this limit with
:func:`sys.setrecursionlimit`.
Note that functions (built-in and user-defined) are pickled by "fully qualified"
name reference, not by value. This means that only the function name is
name reference, not by value.
[#]_
This means that only the function name is
pickled, along with the name of the module the function is defined in. Neither
the function's code, nor any of its function attributes are pickled. Thus the
defining module must be importable in the unpickling environment, and the module
...
...
@@ -850,6 +851,9 @@ The following example reads the resulting pickled data. ::
.. [#] Don't confuse this with the :mod:`marshal` module
.. [#] This is why :keyword:`lambda` functions cannot be pickled: all
:keyword:`lambda` functions share the same name: ``<lambda>``.
.. [#] The exception raised will likely be an :exc:`ImportError` or an
:exc:`AttributeError` but it could be something else.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment