Skip to content

Commit 0c3105b

Browse files
Clarify about prepare_main().
1 parent 40f50e7 commit 0c3105b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Doc/howto/multiple-interpreters.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -814,17 +814,18 @@ passing data between interpreters::
814814

815815
.. _interp-script-args:
816816

817-
Initializing Values for a Script
818-
--------------------------------
817+
Initializing Globals for a Script
818+
---------------------------------
819819

820-
When you call a function in Python, sometimes that function requires
821-
arguments and sometimes it doesn't. In the same way, sometimes a
822-
script you want to run in another interpreter requires some values.
823-
Providing such values to the interpreter, for the script to use,
820+
When you call a function in Python, sometimes that function depends on
821+
arguments, globals, and non-locals, and sometimes it doesn't. In the
822+
same way, sometimes a script you want to run in another interpreter
823+
depends on some global variables. Setting them ahead of time on the
824+
interpreter's :mod:`!__main__` module, where the script will run,
824825
is the simplest kind of communication between interpreters.
825826

826827
There's a method that supports this: :meth:`Interpreter.prepare_main`.
827-
It binds values to names in the interpreter's ``__main__`` module,
828+
It binds values to names in the interpreter's :mod:`!__main__` module,
828829
which makes them available to any scripts that run in the interpreter
829830
after that::
830831

0 commit comments

Comments
 (0)