The When of Python Blog

Guidance on when to use Python features (and when not to).
Comment your opinions on our articles to join the discussion.
Follow us on Twitter and GitHub to get the latest updates first.

Welcome to the When of Python

The When of Python is a fledgling community initiative. The goal is to effectively shrink Python so it fits our brains by providing guidance on when we should use particular language features (and when we should not).

We start with Common Python - the features we should all know so we can basically read each other's work. Clarity on this will be especially useful for teachers and anyone learning Python.

Then there is Situational Python - the Python features that are useful but not for everyone or not all the time. It depends on the situation, for example:

  • Web development might need very different features than scientific Python, e.g. asyncio
  • Advanced library code might need advanced features, e.g. low-level threading / multi-processing

For each feature we try to provide guidance on what the situations are where it is the preferred One Obvious Way. The situations might be defined by domain (e.g. web application development vs data science) or type of code (e.g. scripting vs code with enterprise responsibilities).

Finally there is Deprecated Python - the features we should avoid using. And maybe we should go even further than that - perhaps working through existing code and expunging some features in favour of better alternatives. Soon(ish) we are planning to release some tools to make that easier.

Initial Resources

The When of Python presentation as delivered at Kiwi Pycon 2022, and an addendum of post-conference refinements:


Original presentation:

The When of Python