[Python-ideas] Python 3000 TIOBE -3%

Terry Reedy tjreedy at udel.edu
Fri Feb 10 06:47:29 CET 2012

On 2/9/2012 11:30 PM, Matt Joiner wrote:
> Not true, it's necessary to understand that encodings translate to and
> from bytes,

Only if you use byte encodings for ascii text. I never have, and I would 
not know why you do unless you are using internet modules that do not 
sufficiently hide such details. Anyway...

 >>> b = b'abc'
 >>> u = str(b)
 >>> b = bytes(u, 'ascii')

So one only needs to know one encoding name, which most should know 
anyway, and that it *is* an encoding name.

> and how to use the API.

Give the required parameter, which is standard.

 > In 2.x you rarely needed to know what unicode is.

All one *needs* to know about unicode, that I can see, is that unicode 
is a superset of ascii, that ascii number codes remain the same, and 
that one can ignore just about everything else until one uses (or wants 
to know about) non-ascii characters. Since one will see 'utf-8' here and 
there, it is probably to know that the utf-8 encoding is a superset of 
the ascii encoding, so that ascii text *is* utf-8 text.

Terry Jan Reedy

More information about the Python-ideas mailing list