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-109975: Copyedit 3.13 What's New: C API#124313

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
AA-Turner merged 3 commits intopython:mainfromAA-Turner:docs/whatsnew/c-api
Sep 23, 2024
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
10 changes: 5 additions & 5 deletionsDoc/c-api/monitoring.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
.. highlight:: c

.._monitoring:
.._c-api-monitoring:

Monitoring C API
================
Expand DownExpand Up@@ -141,18 +141,18 @@ would typically correspond to a python function.
to the base-2 logarithm of ``sys.monitoring.events.PY_START``.
``state_array`` is an array with a monitoring state entry for each event in
``event_types``, it is allocated by the user but populated by
``PyMonitoring_EnterScope`` with information about the activation state of
:c:func:`!PyMonitoring_EnterScope` with information about the activation state of
the event. The size of ``event_types`` (and hence also of ``state_array``)
is given in ``length``.

The ``version`` argument is a pointer to a value which should be allocated
by the user together with ``state_array`` and initialized to 0,
and then set only by``PyMonitoring_EnterScope`` itelf. It allows this
and then set only by:c:func:`!PyMonitoring_EnterScope` itelf. It allows this
function to determine whether event states have changed since the previous call,
and to return quickly if they have not.

The scopes referred to here are lexical scopes: a function, class or method.
``PyMonitoring_EnterScope`` should be called whenever the lexical scope is
:c:func:`!PyMonitoring_EnterScope` should be called whenever the lexical scope is
entered. Scopes can be reentered, reusing the same *state_array* and *version*,
in situations like when emulating a recursive Python function. When a code-like's
execution is paused, such as when emulating a generator, the scope needs to
Expand DownExpand Up@@ -189,4 +189,4 @@ would typically correspond to a python function.

.. c:function:: int PyMonitoring_ExitScope(void)

Exit the last scope that was entered with``PyMonitoring_EnterScope``.
Exit the last scope that was entered with:c:func:`!PyMonitoring_EnterScope`.
2 changes: 2 additions & 0 deletionsDoc/c-api/time.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
.. highlight:: c

.. _c-api-time:

PyTime C API
============

Expand Down
2 changes: 1 addition & 1 deletionDoc/library/sys.monitoring.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -262,7 +262,7 @@ Per code object events
Events can also be controlled on a per code object basis. The functions
defined below which accept a :class:`types.CodeType` should be prepared
to accept a look-alike object from functions which are not defined
in Python (see :ref:`monitoring`).
in Python (see :ref:`c-api-monitoring`).

.. function:: get_local_events(tool_id: int, code: CodeType, /) -> int

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp