oop properties in the search order, derived coverage

Find the order of attributes go first to their own, they did not find his father this (his father is the father, he is a subclass)
This is called the derivative is derived subclass inherits the parent class code and the code of the parent class when the code is not the same subclass also add their own new code that is usually derived class is derived and it refers to a subclass 

covering is a subclass the parent class property or method, and this is called appears to cover the same

A class:
text = "haha"

class B (A):
text = "heihei"
Pass

b = B ()
Print (b.text)
so you can call your own call to the


Guess you like

Origin www.cnblogs.com/yangxinpython/p/11247114.html