[issue18156] Add an 'attr' attribute to AttributeError

Brett Cannon report at bugs.python.org
Sat Jun 8 03:54:05 CEST 2013


Brett Cannon added the comment:

What Benjamin said.

Adding something like this is mostly about a nicer constructor (``AttributeError(attr='meth')``) and automatically creating the message for the exception (although that would require another argument like 'object' or something to be able to do e.g. "'dict' object has no attribute 'asdfdsff'" or "type object 'dict' has no attribute 'asdfdsf'").

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18156>
_______________________________________


More information about the Python-bugs-list mailing list