|
6 | 6 | Welcome to mypy documentation! |
7 | 7 | ============================== |
8 | 8 |
|
9 | | -Mypy is a static type checker for Python 3 and Python 2.7. |
| 9 | +Mypy is a static type checker for Python 3 and Python 2.7. If you sprinkle |
| 10 | +your code with type annotations, mypy can type check your code and find common |
| 11 | +bugs. As mypy is a static analyzer, or a lint-like tool, the type |
| 12 | +annotations are just hints for mypy and don't interfere when running your program. |
| 13 | +You run your program with a standard Python interpreter, and the annotations |
| 14 | +are treated effectively as comments. |
| 15 | + |
| 16 | +Using the Python 3 annotation syntax (using :pep:`484` and :pep:`526` notation) |
| 17 | +or a comment-based annotation syntax for Python 2 code, you will be able to |
| 18 | +efficiently annotate your code and use mypy to check the code for common errors. |
| 19 | +Mypy has a powerful and easy-to-use type system with modern features such as |
| 20 | +type inference, generics, callable types, tuple types, union types, and |
| 21 | +structural subtyping. |
| 22 | + |
| 23 | +As a developer, you decide how to use mypy in your workflow. You can always |
| 24 | +escape to dynamic typing as mypy's approach to static typing doesn't restrict |
| 25 | +what you can do in your programs. Using mypy will make your programs easier to |
| 26 | +understand, debug, and maintain. |
| 27 | + |
| 28 | +This documentation provides a short introduction to mypy. It will help you |
| 29 | +get started writing statically typed code. Knowledge of Python and a |
| 30 | +statically typed object-oriented language, such as Java, are assumed. |
| 31 | + |
| 32 | +.. note:: |
| 33 | + |
| 34 | + Mypy is used in production by many companies and projects, but mypy is |
| 35 | + officially beta software. There will be occasional changes |
| 36 | + that break backward compatibility. The mypy development team tries to |
| 37 | + minimize the impact of changes to user code. |
| 38 | + |
| 39 | +Contents |
| 40 | +-------- |
10 | 41 |
|
11 | 42 | .. toctree:: |
12 | 43 | :maxdepth: 2 |
13 | 44 | :caption: First steps |
14 | 45 |
|
15 | | - introduction |
16 | 46 | getting_started |
17 | 47 | existing_code |
18 | 48 |
|
@@ -74,6 +104,13 @@ Mypy is a static type checker for Python 3 and Python 2.7. |
74 | 104 | additional_features |
75 | 105 | faq |
76 | 106 |
|
| 107 | +.. toctree:: |
| 108 | + :hidden: |
| 109 | + :caption: Project Links |
| 110 | + |
| 111 | + GitHub <https://github.com/python/mypy> |
| 112 | + Website <http://mypy-lang.org/> |
| 113 | + |
77 | 114 | Indices and tables |
78 | 115 | ================== |
79 | 116 |
|
|
0 commit comments