]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-53189: Document peculiarities of InteractiveConsole in relation to pickle (GH...
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 20 May 2025 12:08:40 +0000 (15:08 +0300)
committerGitHub <noreply@github.com>
Tue, 20 May 2025 12:08:40 +0000 (14:08 +0200)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Doc/library/code.rst

index 8f7692df9fb22d116da7ff26e16cc6fc5d95dfa4..52587c4dd8f8e87fa8a3688ef4d83a933673fc66 100644 (file)
@@ -22,6 +22,12 @@ build applications which provide an interactive interpreter prompt.
    it defaults to a newly created dictionary with key ``'__name__'`` set to
    ``'__console__'`` and key ``'__doc__'`` set to ``None``.
 
+   Note that functions and classes objects created under an
+   :class:`!InteractiveInterpreter` instance will belong to the namespace
+   specified by *locals*.
+   They are only pickleable if *locals* is the namespace of an existing
+   module.
+
 
 .. class:: InteractiveConsole(locals=None, filename="<console>", local_exit=False)