Skip to content

Commit 6c66117

Browse files
elazarggvanrossum
authored andcommitted
README.md: make intro a bit more friendly (#4002)
1 parent 5252e82 commit 6c66117

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

README.md

+14-16
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,15 @@ What is mypy?
2525
-------------
2626

2727
Mypy is an optional static type checker for Python. You can add type
28-
hints to your Python programs using the standard for type
29-
annotations introduced in Python 3.5 ([PEP 484](https://www.python.org/dev/peps/pep-0484/)), and use mypy to
30-
type check them statically. Find bugs in your programs without even
31-
running them!
32-
33-
The type annotation standard has also been backported to earlier
34-
Python 3.x versions. Mypy supports Python 3.3 and later.
35-
XML based reports do not work on Python 3.3 and 3.4 on Windows.
36-
37-
For Python 2.7, you can add annotations as comments (this is also
38-
specified in [PEP 484](https://www.python.org/dev/peps/pep-0484/)).
28+
hints ([PEP 484](https://www.python.org/dev/peps/pep-0484/)) to your
29+
Python programs, and use mypy to type check them statically.
30+
Find bugs in your programs without even running them!
3931

4032
You can mix dynamic and static typing in your programs. You can always
4133
fall back to dynamic typing when static typing is not convenient, such
4234
as for legacy code.
4335

44-
Here is a small example to whet your appetite:
36+
Here is a small example to whet your appetite (Python 3):
4537

4638
```python
4739
from typing import Iterator
@@ -52,11 +44,20 @@ def fib(n: int) -> Iterator[int]:
5244
yield a
5345
a, b = b, a + b
5446
```
47+
See [the documentation](http://mypy.readthedocs.io/en/stable/introduction.html) for more examples.
48+
49+
For Python 2.7, the standard annotations are written as comments:
50+
```python
51+
def is_palindrome(s):
52+
# type: (str) -> bool
53+
return s == s[::-1]
54+
```
55+
56+
See [the documentation for Python 2 support](http://mypy.readthedocs.io/en/latest/python2.html).
5557

5658
Mypy is in development; some features are missing and there are bugs.
5759
See 'Development status' below.
5860

59-
6061
Requirements
6162
------------
6263

@@ -157,9 +158,6 @@ In Windows, the script is generally installed in
157158

158159
C:\>\Python34\python \Python34\Scripts\mypy PROGRAM
159160

160-
If you are on Windows using Python 3.3 or 3.4, and would like to use XML reports
161-
download LXML from [PyPi](https://pypi.python.org/pypi/lxml).
162-
163161
### Working with `virtualenv`
164162

165163
If you are using [`virtualenv`](https://virtualenv.pypa.io/en/stable/),

0 commit comments

Comments
 (0)