Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Doc/extending/extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ calling the Python callback functions from a C callback. Other uses are also
imaginable.

Fortunately, the Python interpreter is easily called recursively, and there is a
standard interface to call a Python function. (I won't dwell on how to call the
Python parser with a particular string as input --- if you're interested, have a
look at the implementation of the :option:`-c` command line option in
:file:`Modules/main.c` from the Python source code.)
standard interface to call a Python function. (If you're interested in how to call the
Python parser with a particular string as input, have a look at the implementation of
the :option:`-c` command line option in :file:`Modules/main.c` from the Python source
code.)
Comment on lines +234 to +237

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
standard interface to call a Python function. (If you're interested in how to call the
Python parser with a particular string as input, have a look at the implementation of
the :option:`-c` command line option in :file:`Modules/main.c` from the Python source
code.)
standard interface to call a Python function. (If you're interested in how to call the
Python parser with a particular string as input, see :ref:`veryhigh`.)

While we're here, I think we can make this more user friendly. I presume this text was written long ago, before the current comprehensive documentation. (main.c calls _PyRun_SimpleStringFlagsWithName which is exposed, in parts, by various functions detailed on the page.)


Calling a Python function is easy. First, the Python program must somehow pass
you the Python function object. You should provide a function (or some other
Expand Down Expand Up @@ -641,7 +641,7 @@ and the object is freed.

An alternative strategy is called :dfn:`automatic garbage collection`.
(Sometimes, reference counting is also referred to as a garbage collection
strategy, hence my use of "automatic" to distinguish the two.) The big
strategy, hence the use of "automatic" to distinguish the two.) The big
advantage of automatic garbage collection is that the user doesn't need to call
:c:func:`free` explicitly. (Another claimed advantage is an improvement in speed
or memory usage --- this is no hard fact however.) The disadvantage is that for
Expand Down
Loading