Created
December 19, 2013 19:30
-
-
Save calvingiles/8044794 to your computer and use it in GitHub Desktop.
i++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Auto-incremented number, starting at 0. | |
# Relies on function defualts being evaluated only once and lists being mutable. | |
def ipp(__i=[-1]): | |
'''This is a dirty hack''' | |
__i[0] += 1 | |
return __i[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment