Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AAA(object):
- x = 1
- class BBB(AAA):
- pass
- class CCC(AAA):
- pass
- if __name__ == '__main__':
- # AAA: {'x': 1}, BBB: {}, CCC: {}
- print(AAA.x, BBB.x, CCC.x)
- BBB.x = 2
- # AAA: {'x': 1}, BBB: {'x': 2}, CCC: {}
- print(AAA.x, BBB.x, CCC.x)
- AAA.x = 3
- # AAA: {'x': 3}, BBB: {'x': 2}, CCC: {}
- print(AAA.x, BBB.x, CCC.x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement