From 19da811e459587315850410c3a98a90c036ffe16 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Mon, 23 Sep 2024 09:54:01 -0400 Subject: [PATCH] comment nits --- python-spec/src/somacore/coordinates.py | 5 ++--- python-spec/src/somacore/types.py | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/python-spec/src/somacore/coordinates.py b/python-spec/src/somacore/coordinates.py index 986ed83..727dac3 100644 --- a/python-spec/src/somacore/coordinates.py +++ b/python-spec/src/somacore/coordinates.py @@ -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: @@ -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 diff --git a/python-spec/src/somacore/types.py b/python-spec/src/somacore/types.py index 4902b8e..45b9a12 100644 --- a/python-spec/src/somacore/types.py +++ b/python-spec/src/somacore/types.py @@ -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 @@ -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: