From: Serhiy Storchaka Date: Tue, 20 May 2025 12:08:40 +0000 (+0300) Subject: gh-53189: Document peculiarities of InteractiveConsole in relation to pickle (GH... X-Git-Tag: v3.15.0a1~1638 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a31bbc951a9d74cd7b9092555c101e51a2b9482b;p=thirdparty%2FPython%2Fcpython.git gh-53189: Document peculiarities of InteractiveConsole in relation to pickle (GH-123069) Co-authored-by: Terry Jan Reedy --- diff --git a/Doc/library/code.rst b/Doc/library/code.rst index 8f7692df9fb2..52587c4dd8f8 100644 --- a/Doc/library/code.rst +++ b/Doc/library/code.rst @@ -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="", local_exit=False)