Skip to content

Commit 68c679b

Browse files
committed
Fix: function 'filter' accepts first argument 'None'.
1 parent 0226ad6 commit 68c679b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

graalpython/lib-graalpython/functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ def all(iterable):
103103

104104
def filter(func, iterable):
105105
result = []
106+
predicate = func if func is not None else lambda a: a
106107
for i in iterable:
107-
if func(i):
108+
if predicate(i):
108109
result.append(i)
109110
return tuple(result)
110111

0 commit comments

Comments
 (0)