Skip to content

Commit 68b1da7

Browse files
topper-123jschendel
authored andcommitted
CLN: remove compat.lfilter (#26110)
1 parent fd1c3f8 commit 68b1da7

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

pandas/compat/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Cross-compatible functions for different versions of Python.
66
77
Key items to import for compatible code:
8-
* lists: lrange(), lmap(), lzip(), lfilter()
8+
* lists: lrange(), lmap(), lzip()
99
* add_metaclass(metaclass) - class decorator that recreates class with with the
1010
given metaclass instead (and avoids intermediary class creation)
1111
@@ -35,10 +35,6 @@ def lmap(*args, **kwargs):
3535
return list(map(*args, **kwargs))
3636

3737

38-
def lfilter(*args, **kwargs):
39-
return list(filter(*args, **kwargs))
40-
41-
4238
# ----------------------------------------------------------------------------
4339
# functions largely based / taken from the six module
4440

pandas/tests/test_compat.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import builtins
66
import re
77

8-
from pandas.compat import lfilter, lmap, lrange, lzip, re_type
8+
from pandas.compat import lmap, lrange, lzip, re_type
99

1010

1111
class TestBuiltinIterators(object):
@@ -35,14 +35,6 @@ def test_lmap(self):
3535
lengths = 10,
3636
self.check_results(results, expecteds, lengths)
3737

38-
def test_lfilter(self):
39-
func = lambda x: x
40-
lst = list(builtins.range(10))
41-
results = lfilter(lambda x: x, lst),
42-
lengths = 9,
43-
expecteds = list(builtins.filter(func, lst)),
44-
self.check_results(results, expecteds, lengths)
45-
4638
def test_lzip(self):
4739
lst = [builtins.range(10), builtins.range(10), builtins.range(10)]
4840
results = lzip(*lst),

0 commit comments

Comments
 (0)