[Python-checkins] peps: Add annotation to async def example.

guido.van.rossum python-checkins at python.org
Thu May 26 12:21:22 EDT 2016


https://hg.python.org/peps/rev/5dc974539542
changeset:   6342:5dc974539542
user:        Guido van Rossum <guido at python.org>
date:        Thu May 26 09:20:48 2016 -0700
summary:
  Add annotation to async def example.

files:
  pep-0484.txt |  4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/pep-0484.txt b/pep-0484.txt
--- a/pep-0484.txt
+++ b/pep-0484.txt
@@ -1035,8 +1035,8 @@
   async def spam(ignored: int) -> str:
       return 'spam'
 
-  async def foo():
-      bar = await spam(42) # type: str
+  async def foo() -> None:
+      bar = await spam(42)  # type: str
 
 The ``typing.py`` module also provides generic ABCs ``Awaitable``,
 ``AsyncIterable``, and ``AsyncIterator`` for situations where more precise

-- 
Repository URL: https://hg.python.org/peps


More information about the Python-checkins mailing list