[Python-ideas] a new bytestring type?

Antoine Pitrou solipsis at pitrou.net
Sun Jan 5 22:01:44 CET 2014


On Sun, 05 Jan 2014 12:04:20 -0800
Ethan Furman <ethan at stoneleaf.us> wrote:
> On 01/05/2014 11:33 AM, Ethan Furman wrote:
> > As anyone who has worked with Python 3 and low-level protocols knows, Python 3 has no 'bytestring' type.  It has
> > immutable and mutable versions of arrays of integers, otherwise known as 'bytes' and 'bytearray'.
> >
> > How many would be interested in having a 'bytestring'?
> 
> +1
> 
> 
> > What do you see as the distinguishing characteristics?
> 
> Indexing returns a bytestring of length 1, not an integer
> 
> `bytestring(7)` either fails, or returns 'bytestring('\x07')' not 'bytestring(0, 0, 0, 0, 0, 0, 0)'

I agree with that, but it's much too late, and I'm -10 on adding
another, similar but different, bytestring type.

Regards

Antoine.




More information about the Python-ideas mailing list