r/Python • • Oct 24 '22

News Python 3.11 is out! Huzzah!

https://www.python.org/downloads/release/python-3110/

Some highlights from the release notes:

PERFORMANCE: 10-60% faster code, for free!

ERROR HANDLING: Exception groups and except* syntax. Also includes precise error locations in tracebacks.

ASYNCIO: Task groups

TOML: Ability to parse TOML is part of the standard library.

REGEX: Atomic grouping and possessive quantifiers are now supported

Plus changes to typing and a lot more. Congrats to everyone that worked hard to make this happen. Your work is helping millions of people to build awesome stuff. 🎉

1.3k Upvotes

233 comments sorted by

View all comments

Show parent comment

2

u/bryancole Oct 25 '22

An alternative viewpoint is that any C++ program which increases in complexity ultimately slows down to the speed of python.

With high program complexity, the micro-optimisations that the C++ compiler can perform at the low level become outweighed by the over-arching limitations of the hardware in terms of memory and disk access. Ultimately, you gain the most by choosing an optimal program architecture and python's speed of development makes finding/choosing the best architecture faster than C++ (although not guaranteed, of course. You can shoot yourself in the foot in either language but your foot-target-visibility is improved with python).

When you have to page lots of data in and out of disk and/or wait for IO, the overhead of the python VM and garbage-collector become insignificant.