Whitespace test after string.split

David Pratt fairwinds at eastlink.ca
Sat Nov 26 17:20:45 CET 2005

Hi Fredrik and Peter. Many thanks for this helpful advice :-)  These 
are very nice solutions and much better than what I had been 
contemplating. Also thanks for heads up for changes with method.  I am 
still using 2.3 but will move to 2.4 as soon as this is formally 
approved for use in Zope.


On Saturday, November 26, 2005, at 11:42 AM, Fredrik Lundh wrote:

> Peter Otten wrote:
>>>>> [t.strip() for t in s.split(",") if t and not t.isspace()]
>> ['alpha', 'gamma', 'delta']
> footnote: this solution is faster than my filter version.
> </F>
> -- 
> http://mail.python.org/mailman/listinfo/python-list

More information about the Python-list mailing list