Improve type hints in Lib packages

In many of the standard packages located in Lib/ there are little to no type hints. This is not super useful for those using these packages and static type checkers like MyPy. Perhaps I’m unaware of a reason that these packages do not have type hints. If not i’d love to help fix these typing issues that maybe others have had too!

It’s because they are kept externally in GitHub - python/typeshed: Collection of library stubs for Python, with static types .

All the type checkers know about and use typeshed, so it’s not a problem.

3 Likes

Adding the type annotations directly in the code is presumably controversial so probably not a good idea to pursue without some explicit sanction.

3 Likes

Some related past discussions you may find interesting:

6 Likes