|
125 | 125 | ) |
126 | 126 | from warnings import warn |
127 | 127 |
|
128 | | -from typing_extensions import Self |
| 128 | +from typing_extensions import Self, override |
129 | 129 |
|
130 | 130 | from pytools import memoize_method |
131 | 131 |
|
|
146 | 146 | ArrayOrArithContainerOrScalarT, |
147 | 147 | ArrayOrContainerOrScalar, |
148 | 148 | ArrayOrContainerOrScalarT, |
149 | | - ArrayOrContainerT, |
150 | 149 | ContainerOrScalarT, |
151 | 150 | NumpyOrContainerOrScalar, |
152 | 151 | ScalarLike, |
@@ -217,6 +216,7 @@ def __init__(self) -> None: |
217 | 216 | def _get_fake_numpy_namespace(self) -> BaseFakeNumpyNamespace: |
218 | 217 | ... |
219 | 218 |
|
| 219 | + @override |
220 | 220 | def __hash__(self) -> int: |
221 | 221 | raise TypeError(f"unhashable type: '{type(self).__name__}'") |
222 | 222 |
|
@@ -333,12 +333,14 @@ def freeze_thaw( |
333 | 333 | @abstractmethod |
334 | 334 | def tag(self, |
335 | 335 | tags: ToTagSetConvertible, |
336 | | - array: ArrayOrContainerT) -> ArrayOrContainerT: |
| 336 | + array: ArrayOrContainerOrScalarT) -> ArrayOrContainerOrScalarT: |
337 | 337 | """If the array type used by the array context is capable of capturing |
338 | 338 | metadata, return a version of *array* with the *tags* applied. *array* |
339 | 339 | itself is not modified. When working with array containers, the |
340 | 340 | tags are applied to each leaf of the container. |
341 | 341 |
|
| 342 | + Tagging is best-effort. Untaggable types will be returned as-is. |
| 343 | +
|
342 | 344 | See :ref:`metadata` as well as application-specific metadata types. |
343 | 345 |
|
344 | 346 | .. versionadded:: 2021.2 |
|
0 commit comments