]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-138191: Document ``frame.f_generator`` in the data model (GH-138540) (...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 6 Sep 2025 16:59:36 +0000 (18:59 +0200)
committerGitHub <noreply@github.com>
Sat, 6 Sep 2025 16:59:36 +0000 (19:59 +0300)
Co-authored-by: dbXD320 <devanshbaghla320@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Doc/reference/datamodel.rst

index 7a8809e8012a6beaa1ad39345ef1dcba3d24f8ab..15e888006873334b0294ada66c364a7357be2abf 100644 (file)
@@ -1638,6 +1638,7 @@ and are also passed to registered trace functions.
    single: f_locals (frame attribute)
    single: f_lasti (frame attribute)
    single: f_builtins (frame attribute)
+   single: f_generator (frame attribute)
 
 Special read-only attributes
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1675,6 +1676,12 @@ Special read-only attributes
        (this is an index into the :term:`bytecode` string of the
        :ref:`code object <code-objects>`)
 
+   * - .. attribute:: frame.f_generator
+     - The :term:`generator` or :term:`coroutine` object that owns this frame,
+       or ``None`` if the frame is a normal function.
+
+       .. versionadded:: 3.14
+
 .. index::
    single: f_trace (frame attribute)
    single: f_trace_lines (frame attribute)