Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Sep 16, 2024
1 parent 4b2ccca commit 46378b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion python-spec/src/somacore/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

import enum
from typing import Any, Dict, Mapping, Optional, Sequence, TypeVar, Union
from typing import Any, Dict, Mapping, Optional, Sequence, TypeVar, Tuple, Union

import attrs
import numpy as np
Expand Down Expand Up @@ -171,6 +171,7 @@ class ResultOrder(enum.Enum):

SparseNDCoord = Union[
None,
Tuple[int,...],
ValSliceOrSequence[int],
npt.NDArray[np.integer],
pa.IntegerArray,
Expand Down
7 changes: 6 additions & 1 deletion python-spec/src/somacore/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

import sys
from concurrent import futures
from typing import TYPE_CHECKING, NoReturn, Optional, Sequence, Type, TypeVar
from typing import TYPE_CHECKING, Any, NoReturn, Optional, Sequence, Type, TypeVar
from types import get_original_bases

from typing_extensions import Protocol, TypeGuard

Expand Down Expand Up @@ -57,6 +58,10 @@ def stop(self) -> Optional[_T_co]: ...
@property
def step(self) -> Optional[_T_co]: ...

@property
def __orig_bases__(self) -> Any:
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 an @property
# was always regarded as runtime-checkable.
Expand Down

0 comments on commit 46378b5

Please sign in to comment.