Python 3 Adoption, GIL Insights & Industry Updates
Python Bytes: Episode 23 Overview
This episode of Python Bytes covers significant community developments, focusing heavily on the industry-wide shift toward Python 3. The hosts delve into technical deep dives, community service awards, and new infrastructure support for modern Python versions.
Understanding the GIL
A central piece of this discussion is the article "Grok the GIL" by A. Jesse Jiroux Davis. The episode highlights the role of the Global Interpreter Lock (GIL) as a mutex that manages thread safety within CPython.
"One thread runs Python while others sleep or await IO."
* Key insights included:
* The GIL is most effective when handling IO-bound tasks.
* For true parallel computing, users should look into multi-processing modules.
* Small components of code (like list sorting) often remain atomic, which can surprise developers transitioning from languages like C++.
Python 3 Industry Momentum
There is a notable surge in projects dropping support for legacy Python (Python 2) in favor of Python 3, with specific highlights including:
* IPython 6: Now officially supports only Python 3, resulting in a cleaner codebase with approximately 1,500 fewer lines.
* AWS Lambda: The addition of Python 3.6 support for serverless functions, opening new doors for developers.
* CheckIO: This popular gamified learning platform has joined the transition to Python 3.
Community & Infrastructure
- Awards: Ian Cardasco received a 2017 PSF Community Service Award for his extensive work with the PSF election administration and his contributions to the Betamax library.
- Best Practices: The hosts explored the benefits of using a
srcdirectory structure for packaging, noting that it improves project organization and simplifies testing for installed packages.