Steven D'Aprano <[email protected]> added the comment:
You are not looking at the class, you are looking at an instance:
py> exc = ZeroDivisionError('divide by zero')
py> type(exc).__name__
'ZeroDivisionError'
py> exc.__name__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'ZeroDivisionError' object has no attribute '__name__'
----------
nosy: +steven.daprano
resolution: -> not a bug
stage: -> resolved
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue35836>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com