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/2010-August/102867.html below:

[Python-Dev] #2651 - KeyError does not round trip strings

[Python-Dev] #2651 - KeyError does not round trip strings [Python-Dev] #2651 - KeyError does not round trip stringsEric Smith eric at trueblade.com
Thu Aug 5 00:33:05 CEST 2010
On 8/4/2010 6:09 PM, Nick Coghlan wrote:
> On Thu, Aug 5, 2010 at 8:02 AM, Fred Drake<fdrake at acm.org>  wrote:
>> On Wed, Aug 4, 2010 at 5:57 PM, Nick Coghlan<ncoghlan at gmail.com>  wrote:
>>> and use a default message of
>>> "'Key not found: %r' % key" if the key argument is supplied without an
>>> explicit message
>>
>> I suspect you meant a default message of
>>
>>     'Key not found: %r' % (key,)
>>
>> since `key` might be a 1-tuple.  :-)
>
> Gah, you're right.
>
> Maybe I should have said "'Key not found: {}'.format(key)" :)

'Key not found: {!r}'.format(key)

Eric.
More information about the Python-Dev mailing list

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