Ram Rachum added the comment:
Raymond: I do take your point about performance, and I understand that if this
results in a performance problem, then that's a good argument to not include
this feature.
But I'm baffled as to why you're asking me regarding this feature "Why? Is
there any known use case?"
Why do we have an exception text like "TypeError: f() takes 1 positional
argument but 3 were given" instead of "TypeError: f() takes a different number
of arguments than you tried to give it"? Why do we have "ImportError: No module
named 'foobas'" instead of "ImportError: No such module"? Do I need to spell
out the reason and all the different scenario in which these exception text are
super useful?
Why does an operation like `{}[42]` result in `KeyError: 42` instead of
`KeyError: Key doesn't exist"? And now that I think about it, KeyError is used
for control flow too, so why is it okay for it to contain the value, but on
`IndexError` it's a no-no?
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue21911>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com