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

Toby Dickenson tdickenson@geminidataloggers.com
Thu, 8 Feb 2001 14:09:15 -0000

> I once proposed to use a new qualifier for binary data, e.g.
> b"binary data" or d"binary data". Don't remember the outcome though
> as this was during the heated debate over how to do Unicode right
> earlier last year.
> Perhaps the only new type we need is an easy to manage
> binary data type that behaves very much like the old-school
> strings. 

Yes, that all sounds like a good idea. I think changing some "strings" to
b"strings" is a necessary step on the way to 'python -U'. 

I would want to avoid the need for a 2.0-style 'default encoding', so I
suggest it shouldnt be possible to mix this type with other strings:

>>> "1"+b"2"
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: cannot add type "binary" to string
>>> "3"==b"3"