I think the more useful message would be something along the lines of

        AttributeError: can't set attribute 'f' on object of type 'D'

This will help you track down the error. Steven D'Aprano listed three
reasons why it might fail which sounds right but frequently the underlying
reason is something else:

You're trying to set the attribute on the wrong object (e.g., element.color
vs. element.style.color). I wish more error messages identified the types
of the objects involved.

--- Bruce

>
>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/LLYAMITF6K25I7YFUR7TYGX3DQVMSKHQ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to