Python 4

Thanks to ludditism and a failure to recognize an opportunity for better engineering, the transition to Python 3 is only just underway 7 years after it was first released. So it might be a bit premature to be talking about Python 4 already.

By far the thing I’d most like to see in Python 4 is PyPy becoming the official reference implementation, supplanting CPython. This would give a speed of up to 3× to every Python application. There are many reasons this probably won’t happen, but most of the technical ones are surmountable. The remaining two are that Guido probably wouldn’t approve for several reasons, and that much of the CPython team’s knowledge of the existing codebase would be wasted.

As for the technical problems, I think they’re easily enough overcome. For instance, PyPy isn’t compatible with most C extensions to the Python interpreter. This problem needs to be worked at from both ends: C extensions should probably be rewritten to use one or another FFI, and PyPy’s support for the C extension API should be improved. Both would be done with relative speed once PyPy was selected as the successor to CPython.

Another thing I’d like to see is Ruby-esque block syntax. Tav made a good proposal for this; personally, I think using is unnecessary and too long. I’d just use f(args, kw=arg) do (params):; or, if an initial statement-introducing keyword is absolutely required, do f(args, kw=arg) with (params):. do seems far more generic than using.

It’d also be nice to see the regex module replace the current version of the standard library re module.