> The KeyError exception doesn't apply repr() to its argument. That's > annoying in cases like this: > > >>> a = {} > >>> a[''] > Traceback (most recent call last): > File "<stdin>", line 1, in ? > KeyError > >>> > > Should this be fixed? How? (I guess we could add a KeyError__str__ > method to exceptions.c that applies repr().) > > I've got a feeling this is a feature, but not a very useful one. I take it back. args[0] being the actual key that failed is a feature. str() not using repr() on args[0] is a bug. I'll fix it. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4