Rémi Lapeyre <remi.lape...@henki.fr> 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 <rep...@bugs.python.org>
<https://bugs.python.org/issue35954>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to