[I18n-sig] Pre-PEP: Proposed Python Character Model

Paul Prescod paulp@ActiveState.com
Thu, 8 Feb 2001 07:16:01 -0800 (PST)


I really like the idea of the

b"..." prefix

Is anyone opposed?

------

I think we are in sight of agreement on

1. [file]?open(filename, encoding, ...)

2. b"..."

3. an encoding declaration at the top of files

4. that concatenating Python strings and Unicode strings should do the
"obvious" thing for charcters from 127-255 and nothing for characters
beyond.

5. a bytestring type that behaves in every way shape and form like our
current string type but has a different type() and repr().

These would all be small but important incremental moves to a better
Python. As time goes by we can deprecate more and more "ambiguous" usages
like:

 * regular string literals that use non-ASCII characters when there is no
encoding declaration

 * open() calls that do not specify an encoding (or "RAW")

 Paul Prescod