[Python-checkins] r61569 - in sandbox/trunk/2to3/lib2to3: fixes/fix_filter.py tests/test_fixers.py

Raymond Hettinger python at rcn.com
Wed Mar 19 19:06:02 CET 2008


> Probably because filter will return an iterator, 
> so it would have to be wrapped in list: 
> list(filter(bool, seq)).

Note that filter *will* continue to support a None argument in 3.0 (only map() was changed).

The fixer transformation should be:

    filter(None, seq)  -->  list(filter(None, seq))

This most closely matches the original code.


Raymond



More information about the Python-checkins mailing list