Simpler transition to PEP 3000 "Unicode only strings"?

Dieter Maurer dieter at handshake.de
Wed Sep 21 20:39:41 CEST 2005


"Petr Prikryl" <PrikrylP at skil.cz> writes on Tue, 20 Sep 2005 11:21:59 +0200:
> ...
> The idea:
> =========
> 
> What do you think about the following proposal
> that goes the half way
> 
>   If the Python source file is stored in UTF-8 (or
>   other recognised Unicode file format), then the
>   encoding declaration must reflect the format or
>   can be omitted entirely. In such case, all
>   simple string literals will be treated as
>   unicode string literals.
>   
> Would this break any existing code?

Yes: modules that construct byte strings (i.e. strings
which should *not* be unicode strings).

Nevertheless, such a module may be stored in UTF-8.



More information about the Python-list mailing list