From a02d9b2d9c09bf2a89c69dbb91da202a38b06a5d Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Fri, 13 Dec 2024 17:12:36 -0800 Subject: [PATCH] add types to the ndarray type collection key --- src/numpydantic/vendor/nptyping/base_meta_classes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/numpydantic/vendor/nptyping/base_meta_classes.py b/src/numpydantic/vendor/nptyping/base_meta_classes.py index 337e629..76e9e47 100644 --- a/src/numpydantic/vendor/nptyping/base_meta_classes.py +++ b/src/numpydantic/vendor/nptyping/base_meta_classes.py @@ -120,7 +120,7 @@ class SubscriptableMeta(ABCMeta): 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 @abstractmethod @@ -160,7 +160,7 @@ class SubscriptableMeta(ABCMeta): def _create_type( cls, args: Tuple[Any, ...], additional_values: Dict[str, Any] ) -> type: - key = (cls, args) + key = (cls, args, tuple(type(a) for a in args)) if key not in cls._all_types: cls._all_types[key] = type( cls.__name__,