How does the super type present itself and do lookups?
Adam Preble
adam.preble at gmail.com
Tue Mar 10 14:02:43 EDT 2020
On Tuesday, March 10, 2020 at 9:28:11 AM UTC-5, Peter Otten wrote:
> self.foo looks up the attribute in the instance, falls back to the class and
> then works its way up to the parent class, whereas
>
> super().foo bypasses both instance and class, and starts its lookup in the
> parent class.
Is this foo attribute being looked up in an override of __getattr__, __getattribute__, or is it a reserved slot that's internally doing this? That's what I'm trying to figure out.
More information about the Python-list
mailing list