diff options
author | Benjamin Peterson <benjamin@python.org> | 2013-08-21 17:41:19 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2013-08-21 17:41:19 -0500 |
commit | b1972c1c3e57474f49da2d0064bfe3ccd08dcb4a (patch) | |
tree | 66c200fb70953a1b0aace64bb5def311f75f0ef8 | |
parent | 0739fc05e28ec29df1fb2af5cb6747920c4790cd (diff) | |
parent | a4f707f463b8e80d23f09bea707f534aae48e325 (diff) | |
download | six-b1972c1c3e57474f49da2d0064bfe3ccd08dcb4a.tar.gz |
Merged in jaraco/six (pull request #13)
Add six.moves support for filterfalse
-rw-r--r-- | documentation/index.rst | 2 | ||||
-rw-r--r-- | six.py | 1 | ||||
-rw-r--r-- | test_six.py | 7 |
3 files changed, 10 insertions, 0 deletions
diff --git a/documentation/index.rst b/documentation/index.rst index 1f45d50..473e39b 100644 --- a/documentation/index.rst +++ b/documentation/index.rst @@ -430,6 +430,8 @@ Supported renames: +------------------------------+-------------------------------------+-----------------------------------+ | ``filter`` | :func:`py2:itertools.ifilter` | :func:`py3:filter` | +------------------------------+-------------------------------------+-----------------------------------+ +| ``filterfalse`` | :func:`py2:itertools.ifilterfalse` | :func:`py3:itertools.filterfalse` | ++------------------------------+-------------------------------------+-----------------------------------+ | ``http_cookiejar`` | :mod:`py2:cookielib` | :mod:`py3:http.cookiejar` | +------------------------------+-------------------------------------+-----------------------------------+ | ``http_cookies`` | :mod:`py2:Cookie` | :mod:`py3:http.cookies` | @@ -147,6 +147,7 @@ _moved_attributes = [ MovedAttribute("xrange", "__builtin__", "builtins", "xrange", "range"), MovedAttribute("zip", "itertools", "builtins", "izip", "zip"), MovedAttribute("zip_longest", "itertools", "itertools", "izip_longest", "zip_longest"), + MovedAttribute("filterfalse", "itertools", "itertools", "ifilterfalse", "filterfalse"), MovedModule("builtins", "__builtin__"), MovedModule("configparser", "ConfigParser"), diff --git a/test_six.py b/test_six.py index e2131e7..38bd0e5 100644 --- a/test_six.py +++ b/test_six.py @@ -104,6 +104,13 @@ def test_filter(): assert six.advance_iterator(f) == 1 +def test_filter_false(): + from six.moves import filterfalse + f = filterfalse(lambda x: x % 3, range(10)) + assert six.advance_iterator(f) == 0 + assert six.advance_iterator(f) == 3 + assert six.advance_iterator(f) == 6 + def test_map(): from six.moves import map assert six.advance_iterator(map(lambda x: x + 1, range(2))) == 1 |