MRAB <python <at> mrabarnett.plus.com> writes: > > Simon Forman wrote: > [snip] > > > > I'll often do that this way: > > > > args = re.split('\s', line) > > This has the same result, but is shorter and quicker: > > args = line.split() >
HUH? Shorter and quicker, yes, but provides much better functionality; it's NOT the same result: >>> line = ' aaa bbb ccc ' >>> import re >>> re.split('\s', line) ['', '', '', 'aaa', '', '', 'bbb', '', '', 'ccc', '', '', ''] >>> line.split() ['aaa', 'bbb', 'ccc'] >>> -- http://mail.python.org/mailman/listinfo/python-list