Re:A Guide to Python's Magic Methods
by SoftwareMaven on Sunday March 18, 2012 @01:48PM
(#3720255)
__getattribute__ (new classes only!) hijacks the entire lookup machinery; every time you write instance., you will call it.
__getattr__ allows "normal" lookup (is it a method, does it exist in __dict__, etc) to be done by the VM and isn't called until you would otherwise get an AttributeError.
__getattr__ allows "normal" lookup (is it a method, does it exist in __dict__, etc) to be done by the VM and isn't called until you would otherwise get an AttributeError.