PEP 358 and operations on bytes
gabrielg_laburando at yahoo.com.ar
Wed Oct 4 03:11:47 CEST 2006
At Tuesday 3/10/2006 21:52, Ben Finney wrote:
>Gerrit Holl <gerrit at nl.linux.org> writes:
> > operations that aren't currently defined in PEP 358, like:
> > - 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.
>Looking at those, I don't see why they wouldn't be useful for *all*
>sequence types. Perhaps there needs to be a 'seq' type containing
>those common methods, that is the superclass of 'str', 'bytes',
>'list', 'tuple' et cetera.
find() could be useful sometimes.
But what means partition, replace, split, etc on a generic sequence?
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
More information about the Python-list