Function override?

Bernhard Herzog herzog at
Sat Apr 1 17:25:43 EST 2000

"David C. Ullrich" <ullrich at> 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]

Surely, this is not harder to learn than:

while 1:
	line = file.readline()
	if not line:
	# do something


while 1:
	# loop body

	if some_condition:

Bernhard Herzog   | Sketch, a drawing program for Unix
herzog at  |

More information about the Python-list mailing list