As you know, all this is an object in Python. I am wondering if it is possible to create an “object” xto isinstance(x, object)return False. I suspect this is possible with enough abuse of the CPython API, although achieving this with pure Python would be even more interesting.
Initially, I thought that old-style classes would return False, since the hierarchy of objects might not be fully applicable, but it seems to be isinstance(x, object)valid Truefor instances of old-style classes.
Although this is mostly of theoretical interest, it can be interesting (or dangerous) if Python allows you to create a new hierarchy of objects that is disconnected from the base type object.
source
share