Popularity is a curse, quality goes downhill superfast
The typing features are optional, so much so that CPython by default doesn't do anything with them.
>>> def f(x: int):
... return 2 * x
...
>>> f(1)
2
>>> f("hello")
'hellohello'
It's also a weird claim that typing is unpopular, since it's almost universally considered to be a Good Thing™.The rest of the comment honestly sounds like a rant. Python has had governance independent of Guido for some time now, I don't really get the point.
That is true...for now.
But let us look at these two PEPs, only:
https://peps.python.org/pep-0585/s and
https://peps.python.org/pep-0604/
PEP 585 added new syntax for built-in collection types that doesn't work with older versions of Python.
PEP 604 also added new Union and Optional typing syntax that doesn't work with older versions of Python, either. So, you will effectively break your code if you try adding any of these. In a large enough codebase, there could be dozens of these annoying things. Why do that when you could have offloaded every single typing annotation to it's separate module (conveniently called typing), and add a simple shortcut to an IDE to have types removed/re-introduced automatically.
There are even more built-in ways to type your arguments now. So, let's see how long your argument stands.
I don't follow, isn't this just bringing in features from a later version of the language and complaining they don't work? Pattern matching doesn't work in Python 3.9, but I wouldn't say it "effectively breaks your code" just because you try them in python3.9
You also don't have to add them, they're optional.
People governing the development of Python forgot what backwards compatibility of a programming language means.
Also Python predates SemVer, so it doesn't use major.minor.patch. 3.10 is not considered a minor update.
> It should also be emphasized that Python will remain a dynamically typed language, and the authors have no desire to ever make type hints mandatory, even by convention.
We could have kept it as a module-only thing and it would have made it entirely optional feature that you could easily introduce or remove depending on Python version you were targeting. Now, you have types all over and new ways to type random things keep popping up. And of course, that motivated people to propose more stuff like this.
Just utter meaningless "feature", making this language even more convoluted than it already is ever since Guido sold out to Microsoft. Yes, I get it, it's his language and he can do whatever he wants with it. But a lot of people contributed to Python over the decades. And not a lot of them agree on where it is heading.
A sad thing, really.
EDIT: Downvote me to oblivion. Someone had to say it.