Re: __class__ and type() implementation details in CPython

2013-02-10 Thread Steven D'Aprano
Ivan Yurchenko wrote: > Hello. > > I've done the following in CPython 2.7.3 and 3.3.0 (and also in PyPy > 2.0b1): > import weakref x = set() y = weakref.proxy(x) x.__class__, type(x), isinstance(x, set) > (, , True) y.__class__, type(y), isinstance(y, set) > (, , True) >

__class__ and type() implementation details in CPython

2013-02-10 Thread Ivan Yurchenko
Hello. I've done the following in CPython 2.7.3 and 3.3.0 (and also in PyPy 2.0b1): >>> import weakref >>> x = set() >>> y = weakref.proxy(x) >>> x.__class__, type(x), isinstance(x, set) (, , True) >>> y.__class__, type(y), isinstance(y, set) (, , True) So, type doesn't use object's __class__ to