PEP 358 and operations on bytes
Gabriel G
gabrielg_laburando at yahoo.com.ar
Tue Oct 3 21:11:47 EDT 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?
Gabriel Genellina
Softlab SRL
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
More information about the Python-list
mailing list