devguide
devguide copied to clipboard
Clarify usage of type hints in the standard-library modules
I think that Alex summarized the issue pretty well:
In general our policy is currently not to add type hints to standard-library modules in the
Lib/directory (there are some exceptions, but they're all pretty specific). I think we still have yet to add some formal documentation around this in the devguide (we really need to!), but you can see some rationales here:
- https://github.com/python/cpython/pull/108125#discussion_r1313654070
- https://discuss.python.org/t/type-annotations-in-the-stdlib/21487
Originally posted by @AlexWaygood in https://github.com/python/cpython/pull/117583#discussion_r1556105954