Hi,
I think the following behavior of the build in function 'split' is inconsistent.
What do you think?
[color=blue][color=green][color=darkred]
>>> "".split()[/color][/color][/color]
[][color=blue][color=green][color=darkred]
>>> "".split("; ")[/color][/color][/color]
['']
I'm using python 2.3.3 on Windows 2000.
(Perl's split only returns all items up to the last non-empty item,
e.g. <perl>split /;/, "; ;;;"; gets you ['', ' ']. I find this confusing, too).
I think the following behavior of the build in function 'split' is inconsistent.
What do you think?
[color=blue][color=green][color=darkred]
>>> "".split()[/color][/color][/color]
[][color=blue][color=green][color=darkred]
>>> "".split("; ")[/color][/color][/color]
['']
I'm using python 2.3.3 on Windows 2000.
(Perl's split only returns all items up to the last non-empty item,
e.g. <perl>split /;/, "; ;;;"; gets you ['', ' ']. I find this confusing, too).
Comment