type versus __class__
Ian Kelly
ian.g.kelly at gmail.com
Thu Jan 15 01:03:12 EST 2015
On Wed, Jan 14, 2015 at 6:26 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Any other differences?
Objects of classic builtin types don't even have the __class__ attribute.
>>> type(A)
<type 'classobj'>
>>> A.__class__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: class A has no attribute '__class__'
>>> type(C)
<type 'type'>
>>> C.__class__
<type 'type'>
More information about the Python-list
mailing list