Function override?

David C. Ullrich ullrich at math.okstate.edu
Sun Apr 2 15:29:45 EDT 2000


Bernhard Herzog wrote:

> "David C. Ullrich" <ullrich at math.okstate.edu> writes:
>
> >     Or I could if I hadn't just read the bit about how in 1.6 strings
> > have a split method, and if s1 and s2 are strings then
> >
> > s1.split(s2)
> >
> > either splits s1 using s2 as the delimiter or the other way around,
> > depending on which occurs more frequently in the other. I mean
> > surely it will happen that we want to split a bunch of strings
> > using 'delimiter' as a delimiter, and then it just happens that
> > the routine that does that gets passed 'lim' as an argument and
> > does the opposite of what we want?
>
> Oh, that's easy to work around. I'm sure we'll all get used to the
> following new idiom:
>
> (text + delim).split(delim)[:-1]

    What puzzles me about _this_ is that it was posted on
April 2. (So I'm slow - they don't call me "DU" for nothing...)

DU





More information about the Python-list mailing list