[Python-Dev] Generalised String Coercion

"Martin v. Löwis" martin at v.loewis.de
Mon Aug 8 10:00:00 CEST 2005

Guido van Rossum wrote:
> We might be able to get there halfway in Python 2.x: we could
> introduce the bytes type now, and provide separate APIs to read and
> write them. (In fact, the array module and the f.readinto()  method
> make this possible today, but it's too klunky so nobody uses it.
> Perhaps a better API would be a new file-open mode ("B"?) to indicate
> that a file's read* operations should return bytes instead of strings.
> The bytes type could just be a very thin wrapper around array('b').

That answers an important question: so you want the bytes type to be
mutable (and, consequently, unsuitable as a dictionary key).


More information about the Python-Dev mailing list