File tree Expand file tree Collapse file tree 4 files changed +35
-10
lines changed Expand file tree Collapse file tree 4 files changed +35
-10
lines changed Original file line number Diff line number Diff line change 3
3
You can adapt this file completely to your liking, but it should at least
4
4
contain the root `toctree` directive.
5
5
6
- Welcome to Mypy documentation!
6
+ Welcome to mypy documentation!
7
7
==============================
8
8
9
9
Mypy is a static type checker for Python 3 and Python 2.7.
Original file line number Diff line number Diff line change 4
4
# list see the documentation:
5
5
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6
6
7
- # -- Path setup --------------------------------------------------------------
7
+ import sys
8
+ import os
8
9
9
10
# If extensions (or modules to document with autodoc) are in another directory,
10
11
# add these directories to sys.path here. If the directory is relative to the
11
12
# documentation root, use os.path.abspath to make it absolute, like shown here.
12
- #
13
- # import os
14
- # import sys
15
- # sys.path.insert(0, os.path.abspath('.'))
13
+ sys .path .insert (0 , os .path .abspath ('../..' ))
16
14
15
+ from mypy .version import __version__ as mypy_version
17
16
18
17
# -- Project information -----------------------------------------------------
19
18
20
19
project = 'mypyc'
21
20
copyright = '2020, mypyc team'
22
21
author = 'mypyc team'
23
22
23
+ # The version info for the project you're documenting, acts as replacement for
24
+ # |version| and |release|, also used in various other places throughout the
25
+ # built documents.
26
+ #
27
+ # The short X.Y version.
28
+ version = mypy_version .split ('-' )[0 ]
29
+ # The full version, including alpha/beta/rc tags.
30
+ release = mypy_version
24
31
25
32
# -- General configuration ---------------------------------------------------
26
33
Original file line number Diff line number Diff line change 3
3
You can adapt this file completely to your liking, but it should at least
4
4
contain the root `toctree` directive.
5
5
6
- Welcome to mypyc's documentation!
7
- =================================
6
+ Welcome to mypyc documentation!
7
+ ===============================
8
+
9
+ Mypyc compiles Python modules to C extensions. It uses standard Python
10
+ `type hints
11
+ <https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html> `_ to
12
+ generate fast code.
8
13
9
14
.. toctree ::
10
15
:maxdepth: 2
11
- :caption: Contents:
16
+ :caption: First steps
12
17
13
18
introduction
14
19
getting_started
20
+
21
+ .. toctree ::
22
+ :maxdepth: 2
23
+ :caption: Using mypyc
24
+
15
25
using_type_annotations
16
26
native_classes
17
27
differences_from_python
18
28
compilation_units
19
29
30
+ .. toctree ::
31
+ :maxdepth: 2
32
+ :caption: Native operations reference
33
+
20
34
native_operations
21
35
int_operations
22
36
bool_operations
@@ -27,6 +41,10 @@ Welcome to mypyc's documentation!
27
41
set_operations
28
42
tuple_operations
29
43
44
+ .. toctree ::
45
+ :maxdepth: 2
46
+ :caption: Advanced topics
47
+
30
48
performance_tips_and_tricks
31
49
32
50
Indices and tables
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ runtime):
26
26
27
27
* Existing code with type annotations often gets **1.5x to 5x ** faster.
28
28
29
- * Code tuned for mypyc can be **5x to 15x ** faster.
29
+ * Code tuned for mypyc can be **5x to 10x ** faster.
30
30
31
31
There is no simple answer to how fast your code will be when compiled.
32
32
You should try it out!
You can’t perform that action at this time.
0 commit comments