Inside CPython's attribute lookup Python's attribute lookup logic seems pretty simple at a first glance: 'firstlook in the instance __dict__ , then look in its type'. However, the actual logic is much more complex because it needs to take intoaccount the descriptor protocol, the difference between lookups on instancesvs types, and what happens in presence of metaclasses. Recently I implemented…