2to3 . --fix filter -wpn Py2 filter was a list, now filter is an iterator. This lets you have the old behavior. Mechanical. Ref: https://www.artima.com/weblogs/viewpost.jsp?thread=208549