New submission from jcrmatos <[email protected]>:
Hello,
When trying this
try:
1/0
except Exception as exc:
print(type(exc)) # returns <class 'ZeroDivisionError'>
print(exc.__name__) # returns AttributeError: 'ZeroDivisionError' object
has no attribute '__name__'
I believe all classes should have a __name__ attr, correct?
It would be nice to check all the other exceptions to see if any other is also
missing the __name__ attr.
Thanks,
JM
----------
messages: 334416
nosy: jcrmatos
priority: normal
severity: normal
status: open
title: ZeroDivisionError class should have a __name__ attr
versions: Python 3.7
_______________________________________
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