From 71f22f6a4fec3d6dfaf5929078fd5b1f75e5bb3e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 17:39:29 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pyflp/_descriptors.py | 18 ++++++------------ pyflp/_models.py | 12 ++++-------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/pyflp/_descriptors.py b/pyflp/_descriptors.py index 22b5e34..49ae600 100644 --- a/pyflp/_descriptors.py +++ b/pyflp/_descriptors.py @@ -31,16 +31,14 @@ class ROProperty(Protocol[T_co]): """Protocol for a read-only descriptor.""" - def __get__(self, ins: Any, owner: Any = None) -> T_co | Self | None: - ... + def __get__(self, ins: Any, owner: Any = None) -> T_co | Self | None: ... @runtime_checkable class RWProperty(ROProperty[T], Protocol): """Protocol for a read-write descriptor.""" - def __set__(self, ins: Any, value: T) -> None: - ... + def __set__(self, ins: Any, value: T) -> None: ... class NamedPropMixin: @@ -59,12 +57,10 @@ def __init__(self, *ids: EventEnum, default: T | None = None, readonly: bool = F self._readonly = readonly @overload - def _get_event(self, ins: ItemModel[VE]) -> ItemModel[VE]: - ... + def _get_event(self, ins: ItemModel[VE]) -> ItemModel[VE]: ... @overload - def _get_event(self, ins: EventModel) -> AnyEvent | None: - ... + def _get_event(self, ins: EventModel) -> AnyEvent | None: ... def _get_event(self, ins: ItemModel[VE] | EventModel): if isinstance(ins, ItemModel): @@ -85,12 +81,10 @@ def default(self) -> T | None: # Configure version based defaults here return self._default @abc.abstractmethod - def _get(self, ev_or_ins: Any) -> T | None: - ... + def _get(self, ev_or_ins: Any) -> T | None: ... @abc.abstractmethod - def _set(self, ev_or_ins: Any, value: T) -> None: - ... + def _set(self, ev_or_ins: Any, value: T) -> None: ... @final def __get__(self, ins: Any, owner: Any = None) -> T | Self | None: diff --git a/pyflp/_models.py b/pyflp/_models.py index 52a5c91..9528310 100644 --- a/pyflp/_models.py +++ b/pyflp/_models.py @@ -89,24 +89,20 @@ def __eq__(self, o: object) -> bool: @runtime_checkable class ModelCollection(Iterable[MT_co], Protocol[MT_co]): @overload - def __getitem__(self, i: int | str) -> MT_co: - ... + def __getitem__(self, i: int | str) -> MT_co: ... @overload - def __getitem__(self, i: slice) -> Sequence[MT_co]: - ... + def __getitem__(self, i: slice) -> Sequence[MT_co]: ... def supports_slice(func: Callable[[ModelCollection[MT_co], str | int | slice], MT_co]): """Wraps a :meth:`ModelCollection.__getitem__` to return a sequence if required.""" @overload - def wrapper(self: ModelCollection[MT_co], i: int | str) -> MT_co: - ... + def wrapper(self: ModelCollection[MT_co], i: int | str) -> MT_co: ... @overload - def wrapper(self: ModelCollection[MT_co], i: slice) -> Sequence[MT_co]: - ... + def wrapper(self: ModelCollection[MT_co], i: slice) -> Sequence[MT_co]: ... @functools.wraps(func) def wrapper(self: Any, i: Any) -> MT_co | Sequence[MT_co]: