Skip to content
Closed
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
15 changes: 9 additions & 6 deletions Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ The following functions can be safely called before Python is initialized:
* :c:func:`PyMem_RawCalloc`
* :c:func:`PyMem_RawFree`

.. note::

The following functions **should not be called** before
:c:func:`Py_Initialize`: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`,
:c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix` and
:c:func:`Py_GetProgramFullPath` and :c:func:`Py_GetPythonHome`.
On the contrary, the following functions **should not be called** before
:c:func:`Py_Initialize`:

* :c:func:`Py_EncodeLocale`
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this would look better. The list takes more space and attracts more attention (and distract it from the above lists). This list is less important than above lists. Actually the list of functions that should not be called before Py_Initialize() is much longer. ;-) Here are just functions that look similar to functions in the above lists.

Copy link
Member

Choose a reason for hiding this comment

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

But removing the "note" directive LGTM.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we need a distinct section for this list?

* :c:func:`Py_GetExecPrefix`
* :c:func:`Py_GetPath`
* :c:func:`Py_GetPrefix`
* :c:func:`Py_GetProgramFullPath`
* :c:func:`Py_GetPythonHome`


.. _global-conf-vars:
Expand Down