[I18n-sig] Re: Pre-PEP: Proposed Python Character Model
Paul Prescod
paulp@ActiveState.com
Sun, 11 Feb 2001 14:21:18 -0800
Fredrik Lundh wrote:
>
> ...
>
> a more pragmatic approach would be to assume ASCII en-
> codings for binary data, and choke on non-ASCII chars.
>
> >>> "1" + b"2"
> 12
> >>> "1" + buffer("2")
> 12
> >>> "1" + b"\xff"
> ValueError: ASCII decoding error: ordinal not in range(128)
I think that that is the most consistent approach. We should define a
"string type" as one that has compatible with the regular expression
engine, has some defined set of string-like methods and allows
conversion of ordinals less than 128 according to ASCII rules.
Paul Prescod