Be notified of new comments on this post with the RSS feed for this post.
Err, true - that was a typo.. Fixed..
list = range(1,100)
result = filter(lambda y: sys.stdout.write("progress info\n"), filter(lambda x: x % 10 == 0, list))
TADA!
You can use a restricted version of markdown formatting here. You can use the toolbar above the text field to make this more painless. For more information about markdown please refer to the markdown cheatsheet.
That's neat but two things should be that enumerate isn't automatically applied in Python 2.3 to 2.5 and it doesn't appear to be in 2.6 either.. what version of Python is that code for? You need to explicitly call enumerate() in the versions I tested.