1

I'm curious about the following:

When we do attribute lookup on the type, such as type.__hash__, the "type." will trigger a __getattribute__(), but who's __getattribute__() will be invoked in this situation?

There are two possibilities that I can think of:

  1. type's. Because type(type) is type
  2. object's. Because isinstance(type, object) is True.

(... or something else out of my surprise?)

cyc
  • 63
  • 4

0 Answers0