Skip to content

Instantly share code, notes, and snippets.

@campaul
Created January 27, 2015 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save campaul/2504ebd760a9b9ae6b0d to your computer and use it in GitHub Desktop.
Save campaul/2504ebd760a9b9ae6b0d to your computer and use it in GitHub Desktop.
Python 3.4.2 (default, Jan 12 2015, 11:38:40)
[GCC 4.9.2 20141224 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> def foo(x=[]):
... x.append('1')
... return x
...
>>> foo()
['1']
>>> foo()
['1', '1']
>>> foo()
['1', '1', '1']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment