On 09/06/2010 12:35, Antoine Pitrou wrote:
On Wed, 09 Jun 2010 10:41:29 +0200
"M.-A. Lemburg"<m...@egenix.com>  wrote:
The above example will read:

     >>>  b'abc'.transform("hex")
     b'616263'
     >>>  b'616263'.untranform("hex")
     b'abc'
This doesn't look right to me. Hex-encoded "data" is really text (it's
a textual representation of binary, and isn't often used as an opaque
binary transport encoding).
Of course, this is not necessarily so for all codecs. For
base64-encoded data, for example, it is debatable whether you want it
as ASCII bytes or unicode text.

But in both cases you probably want bytes -> bytes and str -> str. If you want text out then put text in, if you want bytes out then put bytes in.

Michael


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk


--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog

READ CAREFULLY. By accepting and reading this email you agree, on behalf of 
your employer, to release me from all obligations and waivers arising from any 
and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, 
clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and 
acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your 
employer, its partners, licensors, agents and assigns, in perpetuity, without 
prejudice to my ongoing rights and privileges. You further represent that you 
have the authority to release me from any BOGUS AGREEMENTS on behalf of your 
employer.


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to