Skip to content

Instantly share code, notes, and snippets.

@dmikurube
Created July 10, 2013 05:34
Show Gist options
  • Save dmikurube/5963711 to your computer and use it in GitHub Desktop.
Save dmikurube/5963711 to your computer and use it in GitHub Desktop.
def test(x, y=[], z=list()):
y.append(x)
print y
z.append(x)
print z
test('foo')
test(42)
test(None)
@dmikurube
Copy link
Author

Output:
['foo']
['foo']
['foo', 42]
['foo', 42]
['foo', 42, None]
['foo', 42, None]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment