Useful Python Idioms, Recipes, and snippets
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Useful Python Idioms, Recipes, and snippets.

Note: These apply mainly to python 3.x as they are built using that version.

This means that either:

  1. An entry will work on 2.7.x
  2. An entry will fail on 2.7.x
  3. An entry won't be efficient on 2.7.x (such as using range vs xrange)
  4. Something I haven't thought of

I try to use the standard library for the majority of my work so most of these will be based off of what is available to everyone who has installed python.

My version: 3.3.2


Raymond Hettinger's Twitter

Useful Python Videos

Python Standard Library Documentation Stack Overflow