Forked from anonymous/class_subclass_attributes.py
Last active
August 29, 2015 14:15
-
-
Save sivy/50402ea08513bc1ac751 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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