From 8c2c809e5fee2cf573fe4e9506be71ee000b2292 Mon Sep 17 00:00:00 2001 From: Nat Date: Fri, 26 May 2023 17:44:34 +0000 Subject: [PATCH] fixed bug where "any" acted as "all" --- typed_python/compiler/tests/any_all_compilation_test.py | 2 ++ typed_python/compiler/type_wrappers/all_any_wrapper.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/typed_python/compiler/tests/any_all_compilation_test.py b/typed_python/compiler/tests/any_all_compilation_test.py index 366d14bd..57d770c0 100644 --- a/typed_python/compiler/tests/any_all_compilation_test.py +++ b/typed_python/compiler/tests/any_all_compilation_test.py @@ -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])) diff --git a/typed_python/compiler/type_wrappers/all_any_wrapper.py b/typed_python/compiler/type_wrappers/all_any_wrapper.py index b19447fe..ba8ebb17 100644 --- a/typed_python/compiler/type_wrappers/all_any_wrapper.py +++ b/typed_python/compiler/type_wrappers/all_any_wrapper.py @@ -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)