Skip to content

Commit

Permalink
comment nits (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-williams authored Sep 23, 2024
1 parent 948754c commit 18e9b06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions python-spec/src/somacore/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ class Axis:


@attrs.define(frozen=True)
class CoordinateSpace(
collections.abc.Sequence
): # Change to Sequence[Axis] after 3.8 is dropped.
class CoordinateSpace(collections.abc.Sequence):
"""A coordinate space for spatial data.
Args:
Expand All @@ -37,6 +35,7 @@ class CoordinateSpace(
Lifecycle: experimental
"""

# Change to Sequence[Axis] after 3.8 is dropped.
axes: Tuple[Axis, ...] = attrs.field(converter=tuple)

@axes.validator
Expand Down
4 changes: 2 additions & 2 deletions python-spec/src/somacore/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def str_or_seq_length(obj: Union[str, Sequence[str]]) -> int:
class Slice(Protocol[_T_co]):
"""A slice which stores a certain type of object.
This protocol describes the built in ``slice`` type, with a hint to callers
This protocol describes the built-in ``slice`` type, with a hint to callers
about what type they should put *inside* the slice. It is for type
annotations only and is not runtime-checkable (i.e., you can't do
``isinstance(thing, Slice)``), because ``range`` objects also have
Expand Down Expand Up @@ -86,7 +86,7 @@ def stop(self) -> Optional[_T_co]: ...
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 an @property
# 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:
Expand Down

0 comments on commit 18e9b06

Please sign in to comment.