add types to the ndarray type collection key

This commit is contained in:
sneakers-the-rat 2024-12-13 17:12:36 -08:00
parent 8bf2203911
commit a02d9b2d9c
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D

View file

@ -120,7 +120,7 @@ class SubscriptableMeta(ABCMeta):
new type is returned for every unique set of arguments. new type is returned for every unique set of arguments.
""" """
_all_types: Dict[Tuple[type, Tuple[Any, ...]], type] = {} _all_types: Dict[Tuple[type, Tuple[Any, ...], tuple[type, ...]], type] = {}
_parameterized: bool = False _parameterized: bool = False
@abstractmethod @abstractmethod
@ -160,7 +160,7 @@ class SubscriptableMeta(ABCMeta):
def _create_type( def _create_type(
cls, args: Tuple[Any, ...], additional_values: Dict[str, Any] cls, args: Tuple[Any, ...], additional_values: Dict[str, Any]
) -> type: ) -> type:
key = (cls, args) key = (cls, args, tuple(type(a) for a in args))
if key not in cls._all_types: if key not in cls._all_types:
cls._all_types[key] = type( cls._all_types[key] = type(
cls.__name__, cls.__name__,