Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ python inherit.py
- D.__dict__= {'__module__': '__main__', 'z': <function z at 0xffedd80c>, '__doc__
- ': None, '__init__': <function __init__ at 0xffedd7d4>}
- C.__dict__= {'__module__': '__main__', 'z': <function z at 0xffedd80c>, '__doc__
- ': None, '__init__': <function __init__ at 0xffedd7d4>}
- C.__dict__= {'__module__': '__main__', '__dict__': <attribute '__dict__' of 'C'
- objects>, 'y': <function y at 0xffedd764>, 'z': <function z at 0xffedd79c>, '__w
- eakref__': <attribute '__weakref__' of 'C' objects>, '__doc__': None, '__init__'
- : <function __init__ at 0xffedd72c>}
- C.__dict__= {'__setattr__': <slot wrapper '__setattr__' of 'object' objects>, '_
- _reduce_ex__': <method '__reduce_ex__' of 'object' objects>, '__new__': <built-i
- n method __new__ of type object at 0x5c9cc6a0>, '__reduce__': <method '__reduce_
- _' of 'object' objects>, '__str__': <slot wrapper '__str__' of 'object' objects>
- , '__format__': <method '__format__' of 'object' objects>, '__getattribute__': <
- slot wrapper '__getattribute__' of 'object' objects>, '__class__': <attribute '_
- _class__' of 'object' objects>, '__delattr__': <slot wrapper '__delattr__' of 'o
- bject' objects>, '__subclasshook__': <method '__subclasshook__' of 'object' obje
- cts>, '__repr__': <slot wrapper '__repr__' of 'object' objects>, '__hash__': <sl
- ot wrapper '__hash__' of 'object' objects>, '__sizeof__': <method '__sizeof__' o
- f 'object' objects>, '__doc__': 'The most base type', '__init__': <slot wrapper
- '__init__' of 'object' objects>}
- CPL[<type 'object'>]=[[<type 'object'>], []]
- 1 round: candidates... <type 'object'>
- CPL[<class '__main__.C'>]=[[<class '__main__.C'>], [<type 'object'>], [<type 'ob
- ject'>]]
- 1 round: candidates... <class '__main__.C'>
- 2 round: candidates... <type 'object'> C.__dict__= {'y': <function y at 0xffed
- d6bc>, '__module__': '__main__', 'z': <function z at 0xffedd6f4>, '__doc__': Non
- e, '__init__': <function __init__ at 0xffedd684>}
- C.__dict__= {'__module__': '__main__', '__dict__': <attribute '__dict__' of 'A'
- objects>, 'y': <function y at 0xffedd614>, 'x': <function x at 0xffedd5dc>, 'z':
- <function z at 0xffedd64c>, '__weakref__': <attribute '__weakref__' of 'A' obje
- cts>, '__doc__': None, '__init__': <function __init__ at 0xffedd5a4>}
- C.__dict__= {'__setattr__': <slot wrapper '__setattr__' of 'object' objects>, '_
- _reduce_ex__': <method '__reduce_ex__' of 'object' objects>, '__new__': <built-i
- n method __new__ of type object at 0x5c9cc6a0>, '__reduce__': <method '__reduce_
- _' of 'object' objects>, '__str__': <slot wrapper '__str__' of 'object' objects>
- , '__format__': <method '__format__' of 'object' objects>, '__getattribute__': <
- slot wrapper '__getattribute__' of 'object' objects>, '__class__': <attribute '_
- _class__' of 'object' objects>, '__delattr__': <slot wrapper '__delattr__' of 'o
- bject' objects>, '__subclasshook__': <method '__subclasshook__' of 'object' obje
- cts>, '__repr__': <slot wrapper '__repr__' of 'object' objects>, '__hash__': <sl
- ot wrapper '__hash__' of 'object' objects>, '__sizeof__': <method '__sizeof__' o
- f 'object' objects>, '__doc__': 'The most base type', '__init__': <slot wrapper
- '__init__' of 'object' objects>}
- CPL[<type 'object'>]=[[<type 'object'>], []]
- 1 round: candidates... <type 'object'>
- CPL[<class '__main__.A'>]=[[<class '__main__.A'>], [<type 'object'>], [<type 'ob
- ject'>]]
- 1 round: candidates... <class '__main__.A'>
- 2 round: candidates... <type 'object'>
- CPL[<class '__main__.B'>]=[[<class '__main__.B'>], [<class '__main__.A'>, <type
- 'object'>], [<class '__main__.A'>]]
- 1 round: candidates... <class '__main__.B'>
- 2 round: candidates... <class '__main__.A'>
- 3 round: candidates... <type 'object'>
- CPL[<class '__main__.D'>]=[[<class '__main__.D'>], [<class '__main__.C'>, <type
- 'object'>], [<class '__main__.B'>, <class '__main__.A'>, <type 'object'>], [<cla
- ss '__main__.C'>, <class '__main__.B'>]]
- 1 round: candidates... <class '__main__.D'>
- 2 round: candidates... <class '__main__.C'>
- 3 round: candidates... <type 'object'> <class '__main__.B'>
- 4 round: candidates... <type 'object'> <class '__main__.A'>
- 5 round: candidates... <type 'object'>
- MRO[<class '__main__.D'>]=[<class '__main__.D'>, <class '__main__.C'>, <class '_
- _main__.B'>, <class '__main__.A'>, <type 'object'>]
- P22 MRO[<class '__main__.D'>]=[<class '__main__.D'>, <class '__main__.C'>, <clas
- s '__main__.B'>, <class '__main__.A'>, <type 'object'>]
- 2
- 3
- 5
- 6
- A.x
- C.y
- D.z
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement