Skip to content

Instantly share code, notes, and snippets.

@kyrylo
Last active December 10, 2015 05:28
Show Gist options
  • Select an option

  • Save kyrylo/4388035 to your computer and use it in GitHub Desktop.

Select an option

Save kyrylo/4388035 to your computer and use it in GitHub Desktop.
# True for Python 2 and Python 3.
def foo(bar = []):
bar.append(1)
print(bar)
foo() #=> [1]
foo() #=> [1, 1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment