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

Antoine Pitrou solipsis at pitrou.net
Fri Nov 15 17:34:58 CET 2013


On Sat, 16 Nov 2013 00:46:15 +1000 Nick Coghlan <ncoghlan at gmail.com> wrote:

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 "", line 1, in >> 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,

Really? That's not what your message said.

Regards

Antoine.



More information about the Python-Dev mailing list