A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-November/130232.html below:

[Python-Dev] Add transform() and untranform() methods

[Python-Dev] Add transform() and untranform() methods [Python-Dev] Add transform() and untranform() methodsNick Coghlan ncoghlan at gmail.com
Fri Nov 15 15:46:15 CET 2013
On 16 November 2013 00:04, Antoine Pitrou <solipsis at pitrou.net> wrote:
>> Rather than the more useful:
>>
>> >>> b"abcdef".decode("hex")
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>> TypeError: 'hex' decoder returned 'bytes' instead of 'str'; use
>> codecs.decode() to decode to arbitrary types
>
> I think this may be confusing.  TypeError seems to suggest that the
> parameter type sent by the user to the method is wrong, which is not
> the actual cause of the error.

The TypeError isn't new, only the part after the semi-colon telling
them that codecs.decode() doesn't include the typecheck (because it
isn't constrained by the text model).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
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