Skip to content

Commit 1efdb8c

Browse files
committed
is_array_type should be an instance method
Some array contexts set their array types at runtime
1 parent 8ffa486 commit 1efdb8c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arraycontext/context.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class ArrayContext(ABC):
196196
with :func:`isinstance`. Other uses are not allowed. This allows
197197
for 'types' with overridden :meth:`type.__instancecheck__`.
198198
199+
.. automethod:: is_array_type
199200
.. automethod:: freeze
200201
.. automethod:: thaw
201202
.. automethod:: freeze_thaw
@@ -483,9 +484,8 @@ def outline(self,
483484
"""
484485
return f
485486

486-
@classmethod
487-
def is_array_type(cls, obj: object) -> TypeIs[Array]:
488-
return isinstance(obj, cls.array_types)
487+
def is_array_type(self, obj: object) -> TypeIs[Array]:
488+
return isinstance(obj, self.array_types)
489489

490490
# undocumented for now
491491
@property

0 commit comments

Comments
 (0)