Skip to content

Instantly share code, notes, and snippets.

Created February 19, 2015 19:09
Show Gist options
  • Save anonymous/11d0c2e5a29b85afbbfa to your computer and use it in GitHub Desktop.
Save anonymous/11d0c2e5a29b85afbbfa to your computer and use it in GitHub Desktop.
class and subclass attributes
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