From 315f2ceb957e9b2d242205482c55ab471f1d6920 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Wed, 2 Aug 2023 16:31:44 +0100 Subject: [PATCH] PEP 492: Resolve unreferenced footnotes (#3241) --- pep-0492.txt | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/pep-0492.txt b/pep-0492.txt index 4a1da0c5f..2905a2576 100644 --- a/pep-0492.txt +++ b/pep-0492.txt @@ -1,7 +1,5 @@ PEP: 492 Title: Coroutines with async and await syntax -Version: $Revision$ -Last-Modified: $Date$ Author: Yury Selivanov Discussions-To: python-dev@python.org Status: Final @@ -558,7 +556,7 @@ an asynchronous one. While this is not a very useful thing to do, the code illustrates the relationship between regular and asynchronous iterators. -:: +.. code:: python class AsyncIteratorWrapper: def __init__(self, obj): @@ -584,7 +582,7 @@ Why StopAsyncIteration? Coroutines are still based on generators internally. So, before PEP 479, there was no fundamental difference between -:: +.. code:: python def g1(): yield from fut @@ -592,7 +590,7 @@ Coroutines are still based on generators internally. So, before PEP and -:: +.. code:: python def g2(): yield from fut @@ -602,7 +600,7 @@ And since :pep:`479` is accepted and enabled by default for coroutines, the following example will have its ``StopIteration`` wrapped into a ``RuntimeError`` -:: +.. code:: python async def a1(): await fut @@ -643,7 +641,7 @@ generators are treated as distinct concepts: doing so will result in a ``TypeError``. 3. *generator-based coroutines* (for asyncio code must be decorated - with ``@asyncio.coroutine``) can ``yield from`` *native coroutine + with ``@asyncio.coroutine`` [1]_) can ``yield from`` *native coroutine objects*. 4. ``inspect.isgenerator()`` and ``inspect.isgeneratorfunction()`` @@ -1218,7 +1216,7 @@ Overall Impact This proposal introduces no observable performance impact. Here is an output of python's official set of benchmarks [4]_: -:: +.. code:: text python perf.py -r -b default ../cpython/python.exe ../cpython-aw/python.exe @@ -1356,7 +1354,7 @@ Working example All concepts proposed in this PEP are implemented [3]_ and can be tested. -:: +.. code:: python import asyncio @@ -1456,12 +1454,3 @@ Copyright ========= This document has been placed in the public domain. - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - coding: utf-8 - End: