Added zip, map, filter to future_bultins (#2171)

This commit is contained in:
David Wolever 2008-03-19 02:35:45 +00:00
parent fbe7c55905
commit 2724ab99c8
4 changed files with 49 additions and 4 deletions

View file

@ -50,6 +50,17 @@ class TestPy3KWarnings(unittest.TestCase):
with catch_warning() as w:
self.assertWarning(cell0 < cell1, w, expected)
def test_filter(self):
from itertools import ifilter
from future_builtins import filter
expected = 'ifilter with None as a first argument is not supported '\
'in 3.x. Use a list comprehension instead.'
with catch_warning() as w:
self.assertWarning(ifilter(None, []), w, expected)
with catch_warning() as w:
self.assertWarning(filter(None, []), w, expected)
def test_code_inequality_comparisons(self):
expected = 'code inequality comparisons not supported in 3.x.'
def f(x):