Rémi Lapeyre <[email protected]> added the comment:
Other methods validate explicitly their arguments with _validate_value_types
for example.
Here it raises KeyError which does not seem to be the appropriate exception.
ConfigParser implementing the mapping protocol it seems weird to me to have
>>> a = 123
>>> config[a] = {}
>>> config[a]
KeyError: 123
I would have prefered a TypeError to be raised on __setitem__ but this is now
documented behavior.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue35954>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com