PEP 358 and operations on bytes

John Machin sjmachin at lexicon.net
Wed Oct 4 17:13:29 CEST 2006


Gerrit Holl wrote:
> On 2006-10-04 05:10:32 +0200, John Machin wrote:
> > >     - str methods endswith, find, partition, replace, split(lines),
> > >       startswith,
> > >     - Regular expressions
> > >
> > > I think those can be useful on a bytes type. Perhaps bytes and str could
> > > share a common parent class? They certainly share a lot of properties
> > > and possible operations one might want to perform.
> > >
> >
> > I look at it this way::
> > Processing text? Use unicode.
> > Binary structures and file I/O, interfacing to 8-bit-wide channels? Use
> > bytes.
>
> But can I use regular expressions on bytes?
> Regular expressions are not limited to text.

So why haven't you been campaigning for regular expression support for
sequences of int, and for various array.array subtypes?




More information about the Python-list mailing list