Skip to content

Instantly share code, notes, and snippets.

@stephenmm
Created January 26, 2014 04:40
Show Gist options
  • Save stephenmm/8628485 to your computer and use it in GitHub Desktop.
Save stephenmm/8628485 to your computer and use it in GitHub Desktop.
" This:
if not session.counter:
session.counter = 1
else:
session.counter += 1
" Is equvalent to this:
session.counter = (session.counter or 0) + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment