Repository navigation
Conversation
Documentation build overview
15 files changed ·
|
There was a problem hiding this comment.
🟡 Changes recommended
The documentation incorrectly identifies shutdown_asyncgens() as the async-generator finalizer callback instead of BaseEventLoop._asyncgen_finalizer_hook, which accepts a generator and schedules its aclose().
1 open issue
What changed in this PR
This documentation-only PR corrects API descriptions, identifiers, and examples across CPython’s C API reference, HOWTOs, library documentation, and language reference.
Changes:
- Correct C API behavior descriptions and type-slot references.
- Fix HOWTO identifiers, formatting examples, and profiling paths.
- Clarify library behavior and update the asynchronous generator finalization reference.
| File | Description |
|---|---|
Doc/reference/expressions.rst |
Updates the asynchronous generator finalization reference. |
Doc/library/textwrap.rst |
Clarifies the lowercase characters used for sentence detection. |
Doc/library/dis.rst |
Corrects the LOAD_SUPER_ATTR index shift direction. |
Doc/library/bz2.rst |
Clarifies that decompression requires compressed input. |
Doc/howto/remote_debugging.rst |
Corrects the executable-path attribute name. |
Doc/howto/perf_profiling.rst |
Corrects the JIT dump filename. |
Doc/howto/isolating-extensions.rst |
Corrects the comment describing kwnames. |
Doc/howto/enum.rst |
Replaces an invalid integer formatting example. |
Doc/howto/descriptor.rst |
Corrects the simulated slots storage attribute name. |
Doc/c-api/typeobj.rst |
Corrects the metaclass call-slot expression. |
Doc/c-api/object.rst |
Corrects the subclass relationship explanation. |
Doc/c-api/gen.rst |
Clarifies how generator objects are created. |
Doc/c-api/gcsupport.rst |
Corrects the source of a reused traversal handler. |
Doc/c-api/frame.rst |
Removes an incorrect PyFrame_GetLasti() return-value claim. |
Review effort: Balanced
| registered *finalizer* to be called upon finalization. For a reference example | ||
| of a *finalizer* method see the implementation of | ||
| ``asyncio.Loop.shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`. | ||
| ``asyncio.BaseEventLoop.shutdown_asyncgens`` in |
| generator-iterator will store the registered *finalizer* to be called upon | ||
| finalization. For a reference example of a *finalizer* method see the | ||
| implementation of ``asyncio.BaseEventLoop._asyncgen_finalizer_hook`` in | ||
| :source:`Lib/asyncio/base_events.py`. |
There was a problem hiding this comment.
@1st1 @asvetlov would you review this part of change?
The documentation conflates async generator finalization during garbage collection with event loop shutdown. The finalizer registered with sys.set_asyncgen_hooks() is called when a generator is about to be garbage collected, while loop.shutdown_asyncgens() explicitly closes the generators tracked by the loop. This change clarifies that distinction and references _asyncgen_finalizer_hook() as the correct callback example.

PyType_Type->tp_callexpression withPy_TYPE(type)->tp_call.tp_traversehandler to a base class.clsappears inderived.__mro__.PyFrame_GetLasti()handlesf_lastibeingNone._slotvalues.%hformatting example with%xforIntEnum.PyCMethod’skwnamesargument as a tuple of keyword argument names./tmp/jit-$PID.dump.sys._base_executable.BZ2Decompressor.needs_inputrefers to new compressed input.LOAD_SUPER_ATTR’s name index calculation to use a right shift.string.ascii_lowercase, matching the algorithm’s[a-z]range.asyncio.BaseEventLoop.shutdown_asyncgens.