From ac9b3b04968d1d81b50aefeeaa2ca67ed0ab99b5 Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Wed, 5 Oct 2022 18:37:06 -0600 Subject: [PATCH] Fix array_attributes Previously it was including every method inherited from object, like __dict__. Now it only includes the properties actually defined on the array stub class. --- array_api_tests/stubs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/array_api_tests/stubs.py b/array_api_tests/stubs.py index 3fba33fc..69ec886d 100644 --- a/array_api_tests/stubs.py +++ b/array_api_tests/stubs.py @@ -36,8 +36,7 @@ if n != "__init__" # probably exists for Sphinx ] array_attributes = [ - n for n, f in inspect.getmembers(array, predicate=lambda x: not inspect.isfunction(x)) - if n != "__init__" # probably exists for Sphinx + n for n, f in inspect.getmembers(array, predicate=lambda x: isinstance(x, property)) ] category_to_funcs: Dict[str, List[FunctionType]] = {}