Skip to content

Instantly share code, notes, and snippets.

@xevix
Created January 12, 2017 00:56
Show Gist options
  • Save xevix/3d45c526fc98af011c1a55f8b219ddd0 to your computer and use it in GitHub Desktop.
Save xevix/3d45c526fc98af011c1a55f8b219ddd0 to your computer and use it in GitHub Desktop.
def foo(a, b={}):
if a == 1:
b["oops"] = "boom"
return b
for i in xrange(3):
print "foo: {}".format(foo(i))
# Output:
# foo: {}
# foo: {'oops': 'boom'}
# foo: {'oops': 'boom'} # oops...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment