[Python-Dev] Generalised String Coercion

Phillip J. Eby pje at telecommunity.com
Mon Aug 8 18:33:39 CEST 2005

At 09:14 AM 8/8/2005 -0700, Guido van Rossum wrote:
>I'm not going to change my mind on text() unless
>someone explains what's so attractive about it.

1. It's obvious to non-programmers what it's for (str and unicode aren't)

2. It's more obvious to programmers that it's a *text* string rather than a 
string of bytes

3. It's easier to type than "unicode", but less opaque than "str"

4. Switching to 'text' and 'bytes' allows for a clean break from any mental 
baggage now associated with 'unicode' and 'str'.

Of course, the flip side to these arguments is that in today's Python, one 
rarely has use for the string type names, except for coercion and some 
occasional type checking.  On the other hand, if we end up with type 
declarations, then these issues become a bit more important.

More information about the Python-Dev mailing list