On 10/20/19 4:34 AM, jf...@ms4.hinet.net wrote: > Yes, there will be an attribute error if no goo() was defined. > > What puzzles me is how a parent's method foo() can find its child's method > goo(), no matter it was overwrote or not? MRO won't explain this and I can't > find document about it also:-( > > --Jach
The simple answer is that the attribute lookup happens at run time, not compile time (unlike some other languages). Thus attributes/member functions can be added by sub-classes, or even just to that instance at run time and be found. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list