A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-September/028545.html below:

[Python-Dev] Should KeyError use repr() on its argument?

[Python-Dev] Should KeyError use repr() on its argument? [Python-Dev] Should KeyError use repr() on its argument?Guido van Rossum guido@python.org
Tue, 03 Sep 2002 15:41:10 -0400
(SF bug 598451.)

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.

--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