need fast parser for comma/space delimited numbers

Aahz Maruch aahz at netcom.com
Sat Mar 18 17:23:58 CET 2000


In article <m2ya7gz7hv.fsf at netmeg.net>,
Les Schaffer  <godzilla at netmeg.net> wrote:
>
>    def __breakStringOnSpace(self, str):
>
>	"""break one line str containing numbers in a string format on
>	whitespace (or comma), return array with the strings representing the
>	numbers."""
>
>        return filter(None, string.splitfields(str, self.splitStr)  )

Why are you using filter?  Why not just

return string.split(str, self.splitStr)
--
                      --- Aahz (Copyright 2000 by aahz at netcom.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

Three sins: BJ, B&J, B&J  --Aahz



More information about the Python-list mailing list