Skip to content

Instantly share code, notes, and snippets.

@luca3m
Created August 26, 2016 09:39
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 luca3m/97f766bbf549171b4b7e44597dd7e113 to your computer and use it in GitHub Desktop.
Save luca3m/97f766bbf549171b4b7e44597dd7e113 to your computer and use it in GitHub Desktop.
Python oddities
def func(param=[]):
param.append("test")
return param
assert func() == [ "test", ]
assert func() == [ "test", "test", ]
assert func() == [ "test", "test", "test" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment