Removing type checker internals from typeshed

We have now added the new _typeshed._type_checker_internals module to typeshed. If you are a type checker author, please update the symbols you use as follows, since we plan on removing the old symbols in the near future:

  • builtins.functiontypes.FunctionType
  • typing._promote_typeshed._type_checker_internals.promote
  • typing.AwaitableGenerator_typeshed._type_checker_internals.AwaitableGenerator
  • typing.NamedTuple_typeshed._type_checker_internals.NamedTupleFallback
  • typing._TypedDict_typeshed._type_checker_internals.TypedDictFallback

We added this new module as a temporary convenience, since we assumed that just moving the symbols would be easier for type checker developers in the short term. Long term, we’d appreciate it if type checkers would move away from using these “fake” types in the _typeshed namespace. That said, we plan to keep supporting this module until type checkers have found an alternative, so no immediate action - apart from the renaming above - is needed.

4 Likes