Skip to content

Commit 99469f3

Browse files
committed
Explain Misc/mypy
1 parent 3c25c95 commit 99469f3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Misc/mypy/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Mypy path symlinks
2+
3+
This directory stores symlinks to standard library modules and packages
4+
that are fully type-annotated and ready to be used in type checking of
5+
the rest of the stdlib or Tools/ and so on.
6+
7+
Due to most of the standard library being untyped, we prefer not to
8+
point mypy directly at `Lib/` for type checking. Additionally, mypy
9+
as a tool does not support shadowing typing-related standard libraries
10+
like `types`, `typing`, and `collections.abc`.
11+
12+
So instead, we set `mypy_path` to include this directory,
13+
which only links modules and packages we know are safe to be
14+
type-checked themselves and used as dependencies.
15+
16+
See `Lib/_pyrepl/mypy.ini` for an example.

0 commit comments

Comments
 (0)