Skip to content

Commit 8ffa486

Browse files
committed
Add ArrayContext.is_array_type
1 parent 280d94f commit 8ffa486

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arraycontext/context.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
)
126126
from warnings import warn
127127

128-
from typing_extensions import Self, override
128+
from typing_extensions import Self, TypeIs, override
129129

130130
from pytools import memoize_method
131131

@@ -483,6 +483,10 @@ def outline(self,
483483
"""
484484
return f
485485

486+
@classmethod
487+
def is_array_type(cls, obj: object) -> TypeIs[Array]:
488+
return isinstance(obj, cls.array_types)
489+
486490
# undocumented for now
487491
@property
488492
@abstractmethod

0 commit comments

Comments
 (0)