Removing type checker internals from typeshed

typeshed still contains a few items in its builtins.pyi and typing.pyi stubs that don’t exist at runtime, but are needed by type checkers. For example builtins.function and typing.AwaitableGenerator. We would like to remove them in the foreseeable future. The current plan is to move these definitions to a new private module _typeshed._tc so that type checkers that still rely on them can switch over. Of course, removing them – or at least some of them – fully from typeshed would be even better, for example by using types.FunctionType instead of builtins.function.

If you are a type checker author, please contribute to the discussion at Remove type checker-specific symbols from builtins.pyi and typing.pyi · Issue #7580 · python/typeshed · GitHub and a first PR at Copy typechecker-internal symbols to `_typeshed._tc` by srittau · Pull Request #13816 · python/typeshed · GitHub.

6 Likes