From 0433d5b4667f173dd9765ddba7611f2d8d85be48 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 7 Oct 2025 12:26:09 -0500 Subject: [PATCH] is_array_type should be an instance method Some array contexts set their array types at runtime --- arraycontext/context.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arraycontext/context.py b/arraycontext/context.py index 5672a13e..a963e544 100644 --- a/arraycontext/context.py +++ b/arraycontext/context.py @@ -196,6 +196,7 @@ class ArrayContext(ABC): with :func:`isinstance`. Other uses are not allowed. This allows for 'types' with overridden :meth:`type.__instancecheck__`. + .. automethod:: is_array_type .. automethod:: freeze .. automethod:: thaw .. automethod:: freeze_thaw @@ -483,9 +484,8 @@ def outline(self, """ return f - @classmethod - def is_array_type(cls, obj: object) -> TypeIs[Array]: - return isinstance(obj, cls.array_types) + def is_array_type(self, obj: object) -> TypeIs[Array]: + return isinstance(obj, self.array_types) # undocumented for now @property