Skip to content

Commit

Permalink
fixed bug where "any" acted as "all"
Browse files Browse the repository at this point in the history
  • Loading branch information
Nat committed Jun 13, 2023
1 parent 81b856f commit 8c2c809
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions typed_python/compiler/tests/any_all_compilation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ def callAll(x):
assert callAll(T([1, 2, 3])) == all(T([1, 2, 3]))
assert callAny(T([0, 0, 0])) == any(T([0, 0, 0]))
assert callAll(T([0, 0, 0])) == all(T([0, 0, 0]))
assert callAny(T([0, 1, 2])) == any(T([0, 1, 2]))
assert callAll(T([0, 1, 2])) == all(T([0, 1, 2]))
2 changes: 1 addition & 1 deletion typed_python/compiler/type_wrappers/all_any_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ def getNativeLayoutType(self):
return native_ast.Type.Struct()

def convert_call(self, context, expr, args, kwargs):
return context.call_py_function(all, args, kwargs)
return context.call_py_function(any, args, kwargs)

0 comments on commit 8c2c809

Please sign in to comment.