Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment nits #226

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading