[Python-Dev] PEP 414 - Unicode Literals for Python 3

martin at v.loewis.de martin at v.loewis.de
Tue Feb 28 09:01:23 CET 2012


> A couple of people have said that 'native string' is spelt 'str', but I'm not
> sure that's the right answer. For example, 2.x's cString.StringIO  
> expects native strings, not Unicode:

Your counter-example is non-ASCII characters/bytes. I doubt that this  
is a valid
use case; in a "native" string, these shouldn't occur (i.e. native  
strings should
always be ASCII), since the semantics of non-ASCII changes drastically between
2.x and 3.x. So whoever defines some API to take "native" strings  
can't have defined
a valid use of non-ASCII in that interface.

> I'm not saying this is the right thing to do for all cases - just  
> that str() may not be, either. This should be elaborated in the PEP.

Indeed it should. If there is a known application of non-ASCII native strings,
I surely would like to know what that is.

Regards,
Martin




More information about the Python-Dev mailing list