@@ -38,7 +38,8 @@ Here is a small example to whet your appetite:
3838from typing import Iterator
3939
4040def fib (n : int ) -> Iterator[int ]:
41- a, b = 0 , 1
41+ a: int = 0
42+ b: int = 1
4243 while a < n:
4344 yield a
4445 a, b = b, a + b
@@ -49,14 +50,21 @@ See 'Development status' below.
4950
5051Annotations
5152-----------
52- You can add type hints to your Python programs using the standard for type
53- annotations introduced in Python 3.5 ([ PEP 484] ( https://www.python.org/dev/peps/pep-0484/ ) ).
54- The type annotation standard has also been backported to earlier
55- Python 3.x versions. Mypy supports Python 3.3 and later.
56- XML based reports do not work on Python 3.3 and 3.4 on Windows.
53+ For Python 3, you can add type hints to your Python programs using the standard for type
54+ annotations ([ PEP 484] ( https://www.python.org/dev/peps/pep-0484/ ) ).
5755
5856For Python 2.7, you can add annotations as comments (this is also
59- specified in [ PEP 484] ( https://www.python.org/dev/peps/pep-0484/ ) ).
57+ specified in [ PEP 484] ( https://www.python.org/dev/peps/pep-0484/ ) ):
58+ ``` python
59+ from typing import Iterator
60+
61+ def fib (n ): # type: int -> Iterator [ int ]
62+ a = 0 # type: int
63+ b = 1 # type: int
64+ while a < n:
65+ yield a
66+ a, b = b, a + b
67+ ```
6068
6169
6270Requirements
@@ -160,7 +168,8 @@ In Windows, the script is generally installed in
160168 C:\>\Python34\python \Python34\Scripts\mypy PROGRAM
161169
162170If you are on Windows using Python 3.3 or 3.4, and would like to use XML reports
163- download LXML from [ PyPi] ( https://pypi.python.org/pypi/lxml ) .
171+ download LXML from [ PyPi] ( https://pypi.python.org/pypi/lxml ) .
172+ XML based reports do not work on Python 3.3 and 3.4 on Windows.
164173
165174### Working with ` virtualenv `
166175
0 commit comments