Hacker News new | past | comments | ask | show | jobs | submit login

I encourage you to open the `typing` documentation [0] and search for the word `deprecated`.

Spoiler alert: the search result will be three-figure.

Some of the results are already scheduled for removal.

[0]: https://docs.python.org/3/library/typing.html




This is the relevant bit:

> The redundant types are deprecated as of Python 3.9. However, while the aliases may be removed at some point, removal of these aliases is not currently planned. As such, no deprecation warnings are currently issued by the interpreter for these aliases.

The idea is that new code shouldn't use them, but they work perfectly fine and will keep working in the near future. Even if they decide to remove these at some point, you're looking at several years before it actually happens, and you'll have plenty of time to migrate.

As it stands, you can use them to your heart's content without issues.


Your quote only refers to a small part of the deprecations, i.e. deprecated type aliases. Deprecations that are not in that group do cause warnings, and some of them are already scheduled for removal.

Your quote also conveniently left out the following paragraph:

> The aliases are guaranteed to remain in the typing module without deprecation warnings until at least Python 3.14.

Python 3.14 is less than a year away.

> Even if they decide to remove these at some point, you're looking at several years before it actually happens, and you'll have plenty of time to migrate.

I agree. I still think it adds to the pile of chores, especially for people who are on the fence anyway as to whether type annotations are worth the additional mental load to them.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: