From 99d68f0d00cdc62f454281d9ca86d4be0dcef1bb Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Mon, 2 Sep 2024 17:08:58 -0700 Subject: [PATCH] python < 3.10 compat for starred unpacking. if this works i'll hug my computer --- src/numpydantic/interface/hdf5.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/numpydantic/interface/hdf5.py b/src/numpydantic/interface/hdf5.py index 9250353..c64b022 100644 --- a/src/numpydantic/interface/hdf5.py +++ b/src/numpydantic/interface/hdf5.py @@ -20,7 +20,7 @@ except ImportError: # pragma: no cover if sys.version_info.minor >= 10: from typing import TypeAlias else: - from typing_extensions import TypeAlias + from typing_extensions import TypeAlias, Unpack H5Arraylike: TypeAlias = Tuple[Union[Path, str], str] @@ -116,7 +116,10 @@ class H5Proxy: obj[key] = value else: if isinstance(key, tuple): - obj[*key, self.field] = value + if sys.version_info.minor >= 10: + obj[*key, self.field] = value + else: + obj[Unpack[key], self.field] = value else: obj[key, self.field] = value