[Python-checkins] r61569 - in sandbox/trunk/2to3/lib2to3: fixes/fix_filter.py tests/test_fixers.py
David Wolever
david at wolever.net
Wed Mar 19 18:02:26 CET 2008
On 19-Mar-08, at 12:41 PM, Collin Winter wrote:
>> Modified:
>> sandbox/trunk/2to3/lib2to3/fixes/fix_filter.py
>> sandbox/trunk/2to3/lib2to3/tests/test_fixers.py
>> Log:
>> Fixed 2to3's handing of filter(None, seq). Now it will return
>> [_f for _f in seq if _f].
> Why that translation? filter(bool, seq) would seem to be more natural.
Probably because filter will return an iterator, so it would have to
be wrapped in list:
list(filter(bool, seq)).
That means we don't need magic variables, though, which is probably a
good thing.
Unless there is an uproar of disagreement, it will be done.
--
David Wolever - http://wolever.net/~wolever
AIM: davidswolever MSN: david at wolever.net
Phone: 416-906-0403
"Without payment you have received; without payment you are to give."
(Mat 10:8 ISV)
More information about the Python-checkins
mailing list