Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-101432: Update the docs for inspect.getcoroutinestate #101435

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
7 changes: 5 additions & 2 deletions Doc/library/inspect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1464,8 +1464,8 @@ generator to be determined easily.

Get current state of a coroutine object. The function is intended to be
used with coroutine objects created by :keyword:`async def` functions, but
will accept any coroutine-like object that has ``cr_running`` and
``cr_frame`` attributes.
will accept any coroutine-like object that has ``cr_running``,
``cr_suspended`` and ``cr_frame`` attributes.

Possible states are:
* CORO_CREATED: Waiting to start execution.
Expand All @@ -1475,6 +1475,9 @@ generator to be determined easily.

.. versionadded:: 3.5

.. versionchanged:: 3.11
Added requirement on ``cr_suspended`` attribute.
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering if we should add 'for coroutine-like object.', i.e.:

Added requirement on cr_suspended attribute for coroutine-like object.


The current internal state of the generator can also be queried. This is
mostly useful for testing purposes, to ensure that internal state is being
updated as expected:
Expand Down