Skip to content

Instantly share code, notes, and snippets.

@drj11
Created November 3, 2016 14:01
Show Gist options
  • Save drj11/287c9f565d387cbfb96f69265c6f41de to your computer and use it in GitHub Desktop.
Save drj11/287c9f565d387cbfb96f69265c6f41de to your computer and use it in GitHub Desktop.
structure sharing
a=[1]
b=['b']
c=['c']
b.append(a)
c.append(a)
print(b)
print(c)
b[1].append('xyz')
print(b)
print(c)
@drj11
Copy link
Author

drj11 commented Nov 3, 2016

I think if you drew a diagram it would become clear that: you don't really use that model above; or, it's terrible.

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