Skip to content

Commit

Permalink
lint: fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
Lancetnik committed Jul 24, 2024
1 parent fbe4bb7 commit cb9cf87
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
5 changes: 3 additions & 2 deletions faststream/broker/fastapi/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(
if isinstance(endpoint, HandlerCallWrapper):
orig_call = endpoint._original_call
while hasattr(orig_call, "__consumer__"):
orig_call = orig_call.__wrapped__ # type: ignore[attr-defined]
orig_call = orig_call.__wrapped__ # type: ignore[union-attr]

else:
orig_call = endpoint
Expand Down Expand Up @@ -106,12 +106,13 @@ def __init__(
)
)

handler: HandlerCallWrapper[Any, Any, Any]
if isinstance(endpoint, HandlerCallWrapper):
endpoint._original_call = call
handler = endpoint

else:
handler = call
handler = call # type: ignore[assignment]

self.handler = broker.subscriber( # type: ignore[assignment,call-arg]
*extra,
Expand Down
4 changes: 2 additions & 2 deletions faststream/utils/classes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, ClassVar, Optional, cast
from typing import Any, ClassVar, Optional

from typing_extensions import Self

Expand Down Expand Up @@ -28,7 +28,7 @@ def __new__(cls, *args: Any, **kwargs: Any) -> Self:
"""
if cls._instance is None:
cls._instance = super().__new__(cls)
return cast(Self, cls._instance)
return cls._instance

@classmethod
def _drop(cls) -> None:
Expand Down
7 changes: 0 additions & 7 deletions serve.py

This file was deleted.

0 comments on commit cb9cf87

Please sign in to comment.