mirror of
https://github.com/python/cpython.git
synced 2025-07-28 13:44:43 +00:00
Added zip, map, filter to future_bultins (#2171)
This commit is contained in:
parent
fbe7c55905
commit
2724ab99c8
4 changed files with 49 additions and 4 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue