Skip to content

Commit

Permalink
rm py3.9 __subclasscheck__ workaround
Browse files Browse the repository at this point in the history
It seems to be causing issues in TileDB-SOMA CI
(single-cell-data/TileDB-SOMA#3246),
and it doesn't seem to be necessary for any tests.
  • Loading branch information
ryan-williams committed Oct 28, 2024
1 parent aba232b commit 8e91526
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions python-spec/src/somacore/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
their own internal type-checking purposes.
"""

import sys
from concurrent import futures
from typing import (
TYPE_CHECKING,
NoReturn,
Optional,
Sequence,
Tuple,
Expand Down Expand Up @@ -85,13 +82,6 @@ def stop(self) -> Optional[_T_co]: ...
@property
def step(self) -> Optional[_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.
@classmethod
def __subclasscheck__(cls, __subclass: type) -> NoReturn:
raise TypeError("Slice is not a runtime-checkable protocol")


def is_slice_of(__obj: object, __typ: Type[_T]) -> TypeGuard[Slice[_T]]:
return (
Expand Down

0 comments on commit 8e91526

Please sign in to comment.