diff --git a/index.html b/index.html index f438d9b..1c06c13 100644 --- a/index.html +++ b/index.html @@ -1172,23 +1172,10 @@ No: if len(seq):
near the top of the file; this tells type checker to ignore all annotations. (More fine-grained ways of disabling complaints from type checkers can be found in PEP 484.)
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 6 currently supports this syntax, and other type checkers are encouraged to adopt it.
For code that needs to be backwards compatible, function annotations can be added in the form of comments. See the relevant section of PEP 484 6.
Hanging indentation is a type-setting style where all the lines in a paragraph are indented except the first line. In the context of Python, the term is used to describe a style where the opening parenthesis of a parenthesized statement is the last non-whitespace character of the line, with subsequent lines being indented until the closing parenthesis.↩
Typeshed repo https://github.com/python/typeshed↩
mypy type checker http://mypy-lang.org https://github.com/JukkaL/mypy↩
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↩