def transform(self, node, results): result = super(FixMap, self).transform(node, results) if not libmodernize.is_listcomp(result): # Always use the import even if no change is required so as to have # improved performance in iterator contexts even on Python 2.7. libmodernize.touch_import(u'six.moves', u'map', node) return result
def transform(self, node, results): result = super(FixFilter, self).transform(node, results) if not libmodernize.is_listcomp(result): # Keep performance improvement from six.moves.filter in iterator # contexts on Python 2.7. libmodernize.touch_import(u'six.moves', u'filter', node) return result