Python Updates, Windows Compatibility, and Coding Trends
Overview
This episode features a deep dive into the evolving CPython ecosystem with special guest Steve Dower, a Microsoft engineer and core developer. The discussion spans recent performance improvements, the nuances of maintaining cross-platform support, and professional coding best practices.
Key Topics
Enumerations in Python
• The hosts discuss the challenges of using standard Enums, noting their rigid comparison behavior.
• A suggested workaround involves deriving from both Enum and str, adding a dunder __str__ method to improve interoperability.
• Steve Dower highlights a technical "gotcha": this method can lead to unexpected equality matches between different Enum types.
Performance and Technical Evolution
• Python 3.10 introduces a roughly 10% performance boost through load method and load global optimizations, largely inspired by PyPy techniques.
• The team clarifies the necessity of dropping support for legacy operating systems like Windows 7, citing the inability of volunteers to maintain security and compatibility on deprecated platforms.
• Discussion on the move to making the 64-bit installer the default for Python on Windows, facilitating better support for scientific packages like NumPy.
Best Practices and Community News
• Robust Bash Scripting: The episode reviews tips such as set -u (to catch uninitialized variables) and set -e (to exit on errors) that help developers write cleaner scripts.
• CPython Core Sprints: A summary of the recent virtual sprints, highlighting the increased accessibility for international contributors who previously could not travel.
• C-Level Performance Proposals: Insights into Mark Shannon's roadmap for potentially achieving a 5x speed increase in CPython through adaptive interpretation and JIT compilation.
"In every case, that's just the trade-off that the language chooses to make. Correctness beats performance. That's almost always what you want."