Tricky Areas in Python

bruno modulix onurb at xiludom.gro
Tue Oct 25 08:39:05 EDT 2005


beza1e1 wrote:
> let me try.
> 
> 1) ''.join(lots_of_pieces)
> 
> 2) This doesn't even work, if something is removed, the list is too
> short. So:
> [x for x in somelist if not isbad(x)]
> well, list comprehension is Python 2.4 

2.2.x IIRC

> and 2.3 is the standard in many
> OSes, so it is possibly not the most portable solution

filter(isbad, somelist)

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list