Skip to content

Commit 9a87cdf

Browse files
committed
rename ag_gen to aga_gen
1 parent eb30c4e commit 9a87cdf

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎Doc/library/inspect.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
284284
| | | ``AGEN_SUSPENDED``, or |
285285
| | | ``AGEN_CLOSED`` |
286286
+-----------------+-------------------+---------------------------+
287-
| async generator | ag_gen | async generator driven by |
287+
| async generator | aga_gen | async generator driven by |
288288
| awaitable | | the awaitable returned |
289289
| | | from ``asend()``, |
290290
| | | ``athrow()``, or |
@@ -368,7 +368,7 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
368368

369369
.. versionchanged:: 3.16
370370

371-
Add ``ag_gen`` attribute to the awaitables returned by the ``asend()``,
371+
Add ``aga_gen`` attribute to the awaitables returned by the ``asend()``,
372372
``athrow()`` and ``aclose()`` methods of async generators.
373373

374374
.. function:: getmembers(object[, predicate])

‎Lib/asyncio/graph.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ def _build_graph_for_future(
7070
if coro.gi_frame is not None:
7171
st.append(FrameCallGraphEntry(coro.gi_frame))
7272
coro = coro.gi_yieldfrom
73-
elif hasattr(coro, 'ag_gen'):
73+
elif hasattr(coro, 'aga_gen'):
7474
# gh-156980: An asend()/athrow() awaitable: step over it to its generator
75-
coro = coro.ag_gen
75+
coro = coro.aga_gen
7676
else:
7777
break
7878

‎Lib/test/test_asyncgen.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ async def gen():
399399
r"cannot reuse already awaited __anext__\(\)/asend\(\)"):
400400
an.send(None)
401401

402-
def test_async_gen_asend_athrow_ag_gen(self):
402+
def test_async_gen_asend_athrow_aga_gen(self):
403403
# gh-156980: asend()/athrow() awaitables expose the generator they drive
404404
async def gen():
405405
yield 1
@@ -408,10 +408,10 @@ async def gen():
408408
asend = g.asend(None)
409409
athrow = g.athrow(ValueError)
410410
try:
411-
self.assertIs(asend.ag_gen, g)
412-
self.assertIs(athrow.ag_gen, g)
411+
self.assertIs(asend.aga_gen, g)
412+
self.assertIs(athrow.aga_gen, g)
413413
with self.assertRaises(AttributeError):
414-
asend.ag_gen = None
414+
asend.aga_gen = None
415415
finally:
416416
asend.close()
417417
athrow.close()

‎Objects/genobject.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2195,7 +2195,7 @@ async_gen_asend_finalize(PyObject *self)
21952195
}
21962196

21972197
static PyMemberDef async_gen_asend_memberlist[] = {
2198-
{"ag_gen", Py_T_OBJECT_EX, offsetof(PyAsyncGenASend, ags_gen), Py_READONLY},
2198+
{"aga_gen", Py_T_OBJECT_EX, offsetof(PyAsyncGenASend, ags_gen), Py_READONLY},
21992199
{NULL} /* Sentinel */
22002200
};
22012201

@@ -2663,7 +2663,7 @@ async_gen_athrow_finalize(PyObject *op)
26632663
}
26642664

26652665
static PyMemberDef async_gen_athrow_memberlist[] = {
2666-
{"ag_gen", Py_T_OBJECT_EX, offsetof(PyAsyncGenAThrow, agt_gen), Py_READONLY},
2666+
{"aga_gen", Py_T_OBJECT_EX, offsetof(PyAsyncGenAThrow, agt_gen), Py_READONLY},
26672667
{NULL} /* Sentinel */
26682668
};
26692669

0 commit comments

Comments
 (0)