[Python-Dev] Exception __name__ missing?
Georg Brandl
g.brandl at gmx.net
Mon Jan 17 21:27:00 CET 2011
Am 17.01.2011 21:22, schrieb Ron Adam:
>
> Is this on purpose?
>
>
> Python 3.2rc1 (py3k:88040, Jan 15 2011, 18:11:39)
> [GCC 4.4.5] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> Exception.__name__
> 'Exception'
> >>> e = Exception('has no name')
> >>> e.__name__
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> AttributeError: 'Exception' object has no attribute '__name__'
It's not on purpose in the sense that it's not something special
to exceptions. The class __name__ attribute is not accessible
from instances of any class.
Georg
More information about the Python-Dev
mailing list