[Python-checkins] peps: Just refer to the spec in PEP 484 for straddling annotations instead of

guido.van.rossum python-checkins at python.org
Mon Mar 21 16:31:21 EDT 2016


https://hg.python.org/peps/rev/656b5fcb530e
changeset: 6263:656b5fcb530e
user: Guido van Rossum <guido at python.org>
date: Mon Mar 21 13:30:24 2016 -0700
summary:
 Just refer to the spec in PEP 484 for straddling annotations instead of repeating the info in PEP 8.
files:
 pep-0008.txt | 22 ++++------------------
 1 files changed, 4 insertions(+), 18 deletions(-)
diff --git a/pep-0008.txt b/pep-0008.txt
--- a/pep-0008.txt
+++ b/pep-0008.txt
@@ -1289,21 +1289,8 @@
 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."""
- <code goes here>
-
- 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."""
- <code goes here>
-
- 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 @@
 .. [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
 
 
 
-- 
Repository URL: https://hg.python.org/peps


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /