diff -r 2f9f5ab3d754 Doc/library/code.rst --- a/Doc/library/code.rst Mon Aug 20 13:49:08 2012 +1000 +++ b/Doc/library/code.rst Mon Aug 20 17:07:40 2012 +1000 @@ -19,6 +19,18 @@ created dictionary with key ``'__name__'`` set to ``'__console__'`` and key ``'__doc__'`` set to ``None``. + Note that class objects created under an InteractiveInterpreter instance will + belong to the namespace defined by *locals*. + + Example of pickling an interactively defined class object: :: + + console = InteractiveInterperter(locals=globals()) + console.runcode(""" + import pickle + class PickleMe: + pass + obj = pickle.loads(pickle.dumps(PickleMe())) + """) .. class:: InteractiveConsole(locals=None, filename="")