Skip to content

Instantly share code, notes, and snippets.

@sivy
Forked from anonymous/class_subclass_attributes.py
Last active August 29, 2015 14:15
Show Gist options
  • Save sivy/50402ea08513bc1ac751 to your computer and use it in GitHub Desktop.
Save sivy/50402ea08513bc1ac751 to your computer and use it in GitHub Desktop.
class Foo(object):
num = 1
ary = []
class Bar(Foo):
pass
Bar.num = 2
Bar.ary.extend([1])
print Bar.num
# 2
print Foo.num
# 1
print Bar.ary
# [1]
print Foo.ary
# [1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment