Type of an object:

Ethan Furman ethan at stoneleaf.us
Tue Dec 17 20:10:49 EST 2013


On 12/17/2013 03:51 PM, Steven D'Aprano wrote:
>
> This leads to another question: we've now seen two examples where
> (presumably) the internal type field and __class__ differ. In the
> weakproxy case, type(obj) returns the internal type field. In the
> "regular" case, where you set obj.__class__ to a class, type(obj) returns
> the new (external) type. How the hell does it decide which one to return?

However it does it, it does it in C.  ;)

--
~Ethan~



More information about the Python-list mailing list