Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-104922: Doc: extending: add note about PY_SSIZE_T_CLEAN#106314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
methane merged 2 commits intopython:mainfrommethane:doc-ssize_t_clean
Jul 2, 2023
Merged
Show file tree
Hide file tree
Changes fromall 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
7 changes: 7 additions & 0 deletionsDoc/extending/embedding.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -87,6 +87,13 @@ perform some operation on a file. ::
Py_ExitStatusException(status);
}

..note::

``#define PY_SSIZE_T_CLEAN`` was used to indicate that ``Py_ssize_t`` should be
used in some APIs instead of ``int``.
It is not necessary since Python 3.13, but we keep it here for backward compatibility.
See:ref:`arg-parsing-string-and-buffers` for a description of this macro.

Setting:c:member:`PyConfig.program_name` should be called before
:c:func:`Py_InitializeFromConfig` to inform the interpreter about paths to Python run-time
libraries. Next, the Python interpreter is initialized with
Expand Down
6 changes: 4 additions & 2 deletionsDoc/extending/extending.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,8 +69,10 @@ the module and a copyright notice if you like).
headers on some systems, you *must* include:file:`Python.h` before any standard
headers are included.

It is recommended to always define ``PY_SSIZE_T_CLEAN`` before including
``Python.h``. See:ref:`arg-parsing-string-and-buffers` for a description of this macro.
``#define PY_SSIZE_T_CLEAN`` was used to indicate that ``Py_ssize_t`` should be
used in some APIs instead of ``int``.
It is not necessary since Python 3.13, but we keep it here for backward compatibility.
See:ref:`arg-parsing-string-and-buffers` for a description of this macro.

All user-visible symbols defined by:file:`Python.h` have a prefix of ``Py`` or
``PY``, except those defined in standard header files. For convenience, and
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp