Skip to content

Commit 464b553

Browse files
Michael0x2agvanrossum
authored andcommitted
Reorganize mypy documentation into sections (#5104)
This commit reorganizes the documentation into different sections. This change should hopefully: 1. Make it a little easier for new users to navigate the docs. 2. Make the nav sidebar feel a little less overwhelming. 3. Make it more obvious which parts of the documentation are about type hint semantics vs which are about specifically mypy. This commit also retitled the cheat sheets: the phrase "mypy syntax" didn't feel quite accurate to me.
1 parent 7e0a15c commit 464b553

File tree

3 files changed

+32
-10
lines changed

3 files changed

+32
-10
lines changed

docs/source/cheat_sheet.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _cheat-sheet-py2:
22

3-
Mypy syntax cheat sheet (Python 2)
4-
==================================
3+
Type hints cheat sheet (Python 2)
4+
=================================
55

66
This document is a quick cheat sheet showing how the `PEP 484 <https://www.python.org/dev/peps/pep-0484/>`_ type
77
language represents various common types in Python 2.

docs/source/cheat_sheet_py3.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _cheat-sheet-py3:
22

3-
Mypy syntax cheat sheet (Python 3)
4-
==================================
3+
Type hints cheat sheet (Python 3)
4+
=================================
55

66
This document is a quick cheat sheet showing how the `PEP 484 <https://www.python.org/dev/peps/pep-0484/>`_ type
77
language represents various common types in Python 3. Unless otherwise noted, the syntax is valid on all versions of Python 3.

docs/source/index.rst

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,53 @@ Mypy is a static type checker for Python 3 and Python 2.7.
1010

1111
.. toctree::
1212
:maxdepth: 2
13+
:caption: First steps
1314

1415
introduction
1516
basics
1617
getting_started
17-
builtin_types
18+
19+
.. toctree::
20+
:maxdepth: 2
21+
:caption: Cheat sheets
22+
23+
cheat_sheet_py3
24+
cheat_sheet
25+
26+
.. toctree::
27+
:maxdepth: 2
28+
:caption: Type system reference
29+
1830
python2
31+
builtin_types
1932
type_inference_and_annotations
2033
kinds_of_types
2134
class_basics
2235
dynamic_typing
2336
function_overloading
2437
casts
2538
duck_type_compatibility
26-
common_issues
2739
generics
28-
supported_python_features
29-
additional_features
40+
41+
.. toctree::
42+
:maxdepth: 2
43+
:caption: Configuring and running mypy
44+
3045
command_line
3146
config_file
3247
mypy_daemon
48+
supported_python_features
3349
python36
50+
additional_features
51+
52+
53+
.. toctree::
54+
:maxdepth: 2
55+
:caption: Miscellaneous
56+
3457
installed_packages
58+
common_issues
3559
faq
36-
cheat_sheet
37-
cheat_sheet_py3
3860
revision_history
3961

4062
Indices and tables

0 commit comments

Comments
 (0)