by hagy · 5y ago · 0 comments
1. simply forward refs in types
2. reduce the runtime costs of type defs
While I can respect both goals, I haven't found either problematic enough to break backwards compatibility, including functionality used in several mainstream libraries.
Further, I have yet to see the runtime costs quantified. So I'm not even convinced this will have a tangible benefit. This PEP rejects the alternative option to just disable typedefs with opt-in __future__ imports or command line optimization args. Yet, they rejected this because it would break existing functionality for code that relies on runtime typedefs. And the proposed solution also breaks existing functionality.
In terms of forward refs, the deferred evaluation just feels like a kludge. Every Python programmer is already familiar with how Python evaluates module code at runtime and understands how this prevents forward refs. If anything, this kludge adds a special case for typedefs.
I really feel its time for Python 3 to freeze language features. This PEP and the previous walrus operator fiasco feel like people trying to morph Python into something that it isn't with one kludge after another. This will not lead to a robust language, but instead another Perl 5 monstrosity of complexity.
Instead, I feel programmers looking for more robust, performant, and expressive languages should start exploring new languages. Let Python be the best possible Python and other language features can be explored in languages that incorporate those features in a holistic design.
I disagree entirely. This is how Python will be left behind. It needs to be able to compete with languages that adopt new features and paradigms.
For example, new Ruby releases got optional typing and pattern matching. Even Java is getting pattern matching[1]. This is where the developer zeitgeist is heading, and if Python doesn't keep up, it'll be replaced with a language that does.
[1] https://benjiweber.co.uk/blog/2021/03/14/java-16-pattern-mat...
Now, everyone is on Python 3 for new stuff, and companies are trying to transition to 3 or paying for the company (who’s name escapes me) that does security updates to 2.7. It never works out. It’s best for the PSF to try to reduce breaking changes and try to keep everyone together.
1. Changes that broke backward compatibility introducing mostly unimportant features
2. Changes that introduced outright mostly unimportant features adding complexity
Instead python programmers' grievances as per "Desired python features" in python surveys [0] are being pushed back.
Top ten programmers' requests actually as per [0] are: static typing, better performance, better concurrency (async syntax...), switch statement (introduced with mindbending gotcha), jit, improve standard library, improve package management, mobile, multiline lambdas, gui.
It appears conclusive discussions in python boards are similar to what Nokia executive board minutes would look like a few years back.
[0]: https://www.jetbrains.com/lp/python-developers-survey-2020/
-- PEP 649 would undo those performance improvements and possibilities of improved static typing over concerns of libraries that user types at runtime having to adapt (I took a look at the issues reported at pydantic and while the API would need to be adapted when PEP 563 would come into effect, I don't really see the major breakage they're talking about -- not that it doesn't take some work to adapt, but I don't see the reason it'd suddenly become impossible to do, it'd only make their own lives a bit easier over the performance cost of all the libraries that use typing without requiring runtime information).
class A:
def x(self) -> B: # doesn't work
return B() # works
class B:
pass
I find this annoying enough that I've been using the future annotations. class A:
def x(self, b=B()): # doesn't work
return B() # works
class B:
passStop adding new features for features sake. I can’t actually think of anything since 3.6 that I yearn to use.
If you can’t add something without breaking backwards comparability, time to release Python 4 and wait another 15 years for adoption.