PEP 358 and operations on bytes

Gerrit Holl gerrit at nl.linux.org
Wed Oct 4 16:56:03 CEST 2006


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.

Gerrit.



More information about the Python-list mailing list