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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com