mirror of
https://github.com/p2p-ld/numpydantic.git
synced 2024-11-12 17:54:29 +00:00
python < 3.10 compat for starred unpacking. if this works i'll hug my computer
This commit is contained in:
parent
2a93694cfc
commit
99d68f0d00
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue