Skip to content

Instantly share code, notes, and snippets.

@santiycr
Last active December 10, 2015 20:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save santiycr/4489869 to your computer and use it in GitHub Desktop.
Save santiycr/4489869 to your computer and use it in GitHub Desktop.
import time declarations, nono!
In [2]: class C(object):
...: def hi(self, k, d=dict()):
...: d[k] = 1
...: print d
...:
In [3]: c = C()
In [4]: c.hi(1)
{1: 1}
In [5]: c.hi(2)
{1: 1, 2: 1}
In [6]: d = C()
In [7]: d.hi(3)
{1: 1, 2: 1, 3: 1}
In [8]:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment