Skip to content

Commit

Permalink
Format with new ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
jodal committed Jul 17, 2024
1 parent 9df290a commit 322acb8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 36 deletions.
9 changes: 3 additions & 6 deletions src/pykka/_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@


class ActorInbox(Protocol):
def put(self, envelope: Envelope[Any], /) -> None:
...
def put(self, envelope: Envelope[Any], /) -> None: ...

def get(self) -> Envelope[Any]:
...
def get(self) -> Envelope[Any]: ...

def empty(self) -> bool:
...
def empty(self) -> bool: ...


class Actor:
Expand Down
18 changes: 6 additions & 12 deletions src/pykka/_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ def ask(
*,
block: Literal[False],
timeout: Optional[float] = None,
) -> Future[Any]:
...
) -> Future[Any]: ...

@overload
def ask(
Expand All @@ -114,8 +113,7 @@ def ask(
*,
block: Literal[True],
timeout: Optional[float] = None,
) -> Any:
...
) -> Any: ...

@overload
def ask(
Expand All @@ -124,8 +122,7 @@ def ask(
*,
block: bool = True,
timeout: Optional[float] = None,
) -> Union[Any, Future[Any]]:
...
) -> Union[Any, Future[Any]]: ...

def ask(
self,
Expand Down Expand Up @@ -180,26 +177,23 @@ def stop(
*,
block: Literal[True],
timeout: Optional[float] = None,
) -> bool:
...
) -> bool: ...

@overload
def stop(
self,
*,
block: Literal[False],
timeout: Optional[float] = None,
) -> Future[bool]:
...
) -> Future[bool]: ...

@overload
def stop(
self,
*,
block: bool = True,
timeout: Optional[float] = None,
) -> Union[Any, Future[Any]]:
...
) -> Union[Any, Future[Any]]: ...

def stop(
self,
Expand Down
9 changes: 3 additions & 6 deletions src/pykka/_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ def stop_all(
*,
block: Literal[True],
timeout: float | None = ...,
) -> list[bool]:
...
) -> list[bool]: ...

@overload
@classmethod
Expand All @@ -159,8 +158,7 @@ def stop_all(
*,
block: Literal[False],
timeout: float | None = ...,
) -> list[Future[bool]]:
...
) -> list[Future[bool]]: ...

@overload
@classmethod
Expand All @@ -169,8 +167,7 @@ def stop_all(
*,
block: bool = True,
timeout: Optional[float] = None,
) -> Union[list[bool], list[Future[bool]]]:
...
) -> Union[list[bool], list[Future[bool]]]: ...

@classmethod
def stop_all(
Expand Down
8 changes: 4 additions & 4 deletions src/pykka/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ class CircleProxy(ActorMemberMixin, ActorProxy[CircleActor]):


class Method(Protocol, Generic[P, R_co]):
def __get__(self, instance: Any, owner: type | None = None) -> Callable[P, R_co]:
...
def __get__(
self, instance: Any, owner: type | None = None
) -> Callable[P, R_co]: ...

def __call__(self, obj: Any, *args: P.args, **kwargs: P.kwargs) -> R_co:
...
def __call__(self, obj: Any, *args: P.args, **kwargs: P.kwargs) -> R_co: ...


def proxy_field(field: T) -> Future[T]:
Expand Down
12 changes: 4 additions & 8 deletions tests/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@


class Event(Protocol):
def clear(self) -> None:
...
def clear(self) -> None: ...

def is_set(self) -> bool:
...
def is_set(self) -> bool: ...

def set(self) -> None:
...
def set(self) -> None: ...

def wait(self, timeout: Optional[float] = None) -> bool:
...
def wait(self, timeout: Optional[float] = None) -> bool: ...


@dataclass
Expand Down

0 comments on commit 322acb8

Please sign in to comment.