[Python-Dev] Unifying Long Integers and Integers: baseint

Guido van Rossum guido at python.org
Thu Aug 12 07:45:04 CEST 2004


> Guido van Rossum wrote:
> > Do we really need byte array literals at all?  I don't expect there to
> > be much of a demand.  
> 
> I'm not so sure. For example, in httplib, in the line
> 
>    h.putrequest('GET', selector)
> 
> I would claim that 'GET' is a byte string, not a character string:
> it is sent as-is onto the wire, which is a byte-oriented wire.
> 
> Now, it would also "work" if it were a character string, which
> then gets converted to a byte string using the system default
> encoding - but I believe that an application that relies on the
> system default encoding is somewhat broken: Explicit is better
> than implicit.

Alternatively, we could postulate that the stream to which the string
is written determines the encoding.  This would still be explicit.

Anyway, if we really do have enough use cases for byte array literals,
we might add them.  I still think that would be confusing though,
because byte arrays are most useful if they are mutable: and then we'd
have mutable literals -- blechhhh!

--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list