diff --git a/python-spec/src/somacore/options.py b/python-spec/src/somacore/options.py index 17faadb..9e66dcd 100644 --- a/python-spec/src/somacore/options.py +++ b/python-spec/src/somacore/options.py @@ -5,7 +5,7 @@ """ import enum -from typing import Any, Dict, Mapping, Optional, Sequence, TypeVar, Union +from typing import Any, Dict, Mapping, Optional, Sequence, Tuple, TypeVar, Union import attrs import numpy as np @@ -175,6 +175,7 @@ class ResultOrder(enum.Enum): SparseNDCoord = Union[ None, + Tuple[int, ...], ValSliceOrSequence[int], npt.NDArray[np.integer], pa.IntegerArray, diff --git a/python-spec/src/somacore/types.py b/python-spec/src/somacore/types.py index 45b9a12..5e93c7b 100644 --- a/python-spec/src/somacore/types.py +++ b/python-spec/src/somacore/types.py @@ -9,6 +9,7 @@ from concurrent import futures from typing import ( TYPE_CHECKING, + Any, NoReturn, Optional, Sequence, @@ -85,6 +86,16 @@ def stop(self) -> Optional[_T_co]: ... @property def step(self) -> Optional[_T_co]: ... + if sys.version_info >= (3, 12): + + @property + def __orig_bases__(self) -> Any: + # Only exists in Python 3.12 and above + from types import get_original_bases + + return get_original_bases(int) + # return get_original_bases(_T_co) + if sys.version_info < (3, 10) and not TYPE_CHECKING: # Python 3.9 and below have a bug where any Protocol with a @property # was always regarded as runtime-checkable.