Python typing-extensions — ELI5

Imagine Python just announced a brand-new crayon colour. It looks amazing, but it only comes in the newest crayon box (the latest Python version). If you have an older box, you’re out of luck — unless someone makes that exact colour and sells it separately.

That’s what typing-extensions does for Python’s type system.

What are type hints? Type hints are little labels you put on your code to say “this box holds numbers” or “this function returns text.” They help tools catch mistakes before your program even runs.

The problem. Python adds new type hint features in every major release (3.10, 3.11, 3.12, 3.13…). But most real projects can’t upgrade to the latest Python immediately. They might be stuck on 3.9 or 3.10 for years because upgrading is risky or their hosting provider doesn’t support the new version.

The solution. typing-extensions is a package you install with pip. It copies the newest type hint features from future Python versions and makes them work on older ones. When Python 3.12 introduced a fancy new TypedDict feature, typing-extensions made it available to people still on 3.9.

How do you use it? Instead of importing from typing, you import from typing_extensions:

from typing_extensions import TypedDict, Self, override

When you eventually upgrade Python, you can switch the import back — the types work exactly the same way.

The one thing to remember: typing-extensions is a time machine for type hints — use features from new Python versions today, on whatever version you’re running.

pythontypingtype-hints

See Also

  • Python 310 New Features Python 3.10 gave programmers a shape-sorting machine, friendlier error messages, and cleaner ways to say 'this or that' in type hints.
  • Python 311 New Features Python 3.11 made everything faster, error messages smarter, and let you catch several mistakes at once instead of stopping at the first one.
  • Python 312 New Features Python 3.12 made type hints shorter, f-strings more powerful, and started preparing Python's engine for a world without the GIL.
  • Python 313 New Features Python 3.13 finally lets multiple tasks run at the same time for real, added a speed booster engine, and gave the interactive prompt a colourful makeover.
  • Python Exception Groups Python's ExceptionGroup is like getting one report card that lists every mistake at once instead of stopping at the first one.