Stefan Behnel <stefan...@behnel.de> added the comment:

I agree that SystemError is the wrong response. Whether it needs to be 
AttributeError – probably fine to consider this an implementation detail. 
TypeError also seems ok in at least some of the cases. I think we should widen 
the code to expect some kind of Mapping (instead of strictly a dict), and if we 
don't find that on access, a TypeError seems just as good as an AttributeError 
from Python.

I'm unsure if we should restrict assignments to ".attrib". It's probably enough 
to allow "None" assignments to say "no attributes allowed", Everything else can 
be handled by some kind of Mapping object. But then, why not just use the 
Mapping protocol on access and leave errors to that stage?

----------
stage:  -> needs patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39538>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to