[Python-3000] PEP 3138- String representation in Python 3000

Paramjit Oberoi param at cs.wisc.edu
Thu May 15 17:06:34 CEST 2008


On Thu, May 15, 2008 at 3:06 AM, Paul Moore <p.f.moore at gmail.com> wrote:
> On 15/05/2008, Guido van Rossum <guido at python.org> wrote:
>> Consider code that gets an encoding passed in as a
>> variable e. It knows it has a bytes instance b. To encode b from bytes
>> to str (unicode), it can use s = b.decode(e).
>
> To encode, you use .decode? It's nice to know it's not just me who has
> trouble keeping the terminology straight...

It takes a lot of effort, and constant vigilance, to keep
encode/decode straight in one's head.  Maybe this means they need to
be renamed to something like tobytes() and tostring()?

tostring() is probably not the best choice though - too much baggage from java.

-param


More information about the Python-3000 mailing list