Skip to content

Commit e3dbe1b

Browse files
authored
README: Add note about typing_extensions and _typeshed (#289)
Refs pandas-dev/pandas-stubs#345 (comment)
1 parent f715632 commit e3dbe1b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ all cases:
9696
[a few bugs](https://github.com/python/mypy/issues?q=is%3Aopen+is%3Aissue+label%3Atopic-pep-604+label%3Atopic-type-alias)
9797
regarding PEP 604 type aliases.
9898

99+
Note that several error codes recommend using types from `typing_extensions` or
100+
`_typeshed`. Strictly speaking, these packages are not part of the standard
101+
library. However, these packages are included in typeshed's `stdlib/`
102+
directory, meaning that type checkers believe them to be part of the standard
103+
library even if this does not reflect the reality at runtime. As such, since
104+
stubs are never executed at runtime, types from `typing_extensions` and
105+
`_typeshed` can be used freely in a stubs package, even if the package does not
106+
have an explicit dependency on either `typing_extensions` or typeshed.
107+
99108
## License
100109

101110
MIT

0 commit comments

Comments
 (0)