diff --git a/pep-0008.txt b/pep-0008.txt index ca9cf7dbd..d88d11306 100644 --- a/pep-0008.txt +++ b/pep-0008.txt @@ -1289,21 +1289,8 @@ annotations are changing. the library author's permission) through the typeshed repo [4]_. - For code that needs to be backwards compatible, function annotations - can be added in the form of comments. Basically, this Python 3 annotation:: - - def embezzle(self, account: str, funds: int = 1000000, **fake_receipts: str) -> None: - """Embezzle funds from account using fake receipts.""" - - - is equivalent to the following:: - - def embezzle(self, account, funds=1000000, **fake_receipts): - # type: (str, int, **str) -> None - """Embezzle funds from account using fake receipts.""" - - - The mypy type checker [5]_ currently supports this syntax, and other - type checkers are encouraged to adopt it. + can be added in the form of comments. See the relevant section of + PEP 484 [5]_. .. rubric:: Footnotes @@ -1329,9 +1316,8 @@ References .. [4] Typeshed repo https://github.com/python/typeshed -.. [5] mypy type checker - http://mypy-lang.org - https://github.com/JukkaL/mypy +.. [5] Suggested syntax for Python 2.7 and straddling code + https://www.python.org/dev/peps/pep-0484/#suggested-syntax-for-python-2-7-and-straddling-code