We propose adding powerful type-level introspection and construction facilities to Python’s type system. This design is inspired largely by TypeScript’s conditional and mapped types, but is adapted to the distinct semantics and constraints of Python’s typing model.

PEP 827 – Type Manipulation | peps.python.org
We propose adding powerful type-level introspection and construction facilities to Python’s type system. This design is inspired largely by TypeScript’s conditional and mapped types, but is adapted to the distinct semantics and constraints of Python’s t...