Skip to content

Commit 79477c2

Browse files
authored
Merge pull request #482 from PythonCharmers/revert-466-master
Revert "Add fixer for itertools"
2 parents e959c9a + d42f078 commit 79477c2

File tree

5 files changed

+0
-137
lines changed

5 files changed

+0
-137
lines changed

docs/futurize.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ The complete set of fixers applied by ``futurize --stage1`` is:
103103
lib2to3.fixes.fix_ws_comma
104104
lib2to3.fixes.fix_xreadlines
105105
libfuturize.fixes.fix_absolute_import
106-
libfuturize.fixes.fix_itertools
107106
libfuturize.fixes.fix_next_call
108107
libfuturize.fixes.fix_print_with_import
109108
libfuturize.fixes.fix_raise

src/future/builtins/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@
1818
import builtins
1919
bytes = builtins.bytes
2020
dict = builtins.dict
21-
filter = builtins.filter
2221
int = builtins.int
2322
list = builtins.list
24-
map = builtins.map
2523
object = builtins.object
2624
range = builtins.range
2725
str = builtins.str
28-
zip = builtins.zip
2926
__all__ = []
3027
else:
3128
from future.types import (newbytes as bytes,
@@ -35,9 +32,6 @@
3532
newobject as object,
3633
newrange as range,
3734
newstr as str)
38-
from itertools import (ifilter as filter,
39-
imap as map,
40-
izip as zip)
4135
from future import utils
4236

4337

src/libfuturize/fixes/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969

7070
libfuturize_fix_names_stage1 = set([
7171
'libfuturize.fixes.fix_absolute_import',
72-
'libfuturize.fixes.fix_itertools',
7372
'libfuturize.fixes.fix_next_call', # obj.next() -> next(obj). Unlike
7473
# lib2to3.fixes.fix_next, doesn't change
7574
# the ``next`` method to ``__next__``.

src/libfuturize/fixes/fix_itertools.py

Lines changed: 0 additions & 54 deletions
This file was deleted.

tests/test_future/test_futurize.py

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -453,81 +453,6 @@ def test_xrange(self):
453453
"""
454454
self.convert_check(before, after, ignore_imports=False)
455455

456-
def test_filter(self):
457-
"""
458-
Tests correct handling of itertools.ifilter
459-
"""
460-
before = """
461-
import itertools
462-
itertools.ifilter(lambda x: x%2, [1, 2, 3, 4])
463-
"""
464-
after = """
465-
from builtins import filter
466-
import itertools
467-
filter(lambda x: x%2, [1, 2, 3, 4])
468-
"""
469-
self.convert_check(before, after, ignore_imports=False)
470-
before = """
471-
from itertools import ifilter
472-
ifilter(lambda x: x%2, [1, 2, 3, 4])
473-
"""
474-
after = """
475-
from builtins import filter
476-
477-
filter(lambda x: x%2, [1, 2, 3, 4])
478-
"""
479-
self.convert_check(before, after, ignore_imports=False)
480-
481-
def test_map(self):
482-
"""
483-
Tests correct handling of itertools.imap
484-
"""
485-
before = """
486-
import itertools
487-
itertools.imap(pow, (2,3,10), (5,2,3))
488-
"""
489-
after = """
490-
from builtins import map
491-
import itertools
492-
map(pow, (2,3,10), (5,2,3))
493-
"""
494-
self.convert_check(before, after, ignore_imports=False)
495-
before = """
496-
from itertools import imap
497-
imap(pow, (2,3,10), (5,2,3))
498-
"""
499-
after = """
500-
from builtins import map
501-
502-
map(pow, (2,3,10), (5,2,3))
503-
"""
504-
self.convert_check(before, after, ignore_imports=False)
505-
506-
def test_zip(self):
507-
"""
508-
Tests correct handling of itertools.izip
509-
"""
510-
before = """
511-
import itertools
512-
itertools.izip('ABCD', 'xy')
513-
"""
514-
after = """
515-
from builtins import zip
516-
import itertools
517-
zip('ABCD', 'xy')
518-
"""
519-
self.convert_check(before, after, ignore_imports=False)
520-
before = """
521-
from itertools import izip
522-
izip('ABCD', 'xy')
523-
"""
524-
after = """
525-
from builtins import zip
526-
527-
zip('ABCD', 'xy')
528-
"""
529-
self.convert_check(before, after, ignore_imports=False)
530-
531456
def test_source_coding_utf8(self):
532457
"""
533458
Tests to ensure that the source coding line is not corrupted or

0 commit comments

Comments
 (0)