mirror of
https://github.com/stoatchat/python-client-sdk.git
synced 2026-07-25 08:25:28 -04:00
Fix typing bugs
This commit is contained in:
@@ -36,7 +36,7 @@ class ExtensionProtocol(Protocol):
|
||||
class CommandsMeta(type):
|
||||
_commands: list[Command[Any]]
|
||||
|
||||
def __new__(cls, name: str, bases: tuple[type, ...], attrs: dict[str, Any]) -> Self:
|
||||
def __new__(cls, name: str, bases: tuple[type, ...], attrs: dict[str, Any]) -> Any:
|
||||
commands: list[Command[Any]] = []
|
||||
self = super().__new__(cls, name, bases, attrs)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Callable, Coroutine, Generic, Optional, TypeVar, cast
|
||||
from typing_extensions import ParamSpec, Self
|
||||
from typing_extensions import ParamSpec
|
||||
|
||||
from revolt.errors import RevoltError
|
||||
|
||||
@@ -18,7 +18,7 @@ class CogMeta(type, Generic[ClientT_D]):
|
||||
_cog_listeners: dict[str, list[str]]
|
||||
qualified_name: str
|
||||
|
||||
def __new__(cls, name: str, bases: tuple[type, ...], attrs: dict[str, Any], *, qualified_name: Optional[str] = None, extras: dict[str, Any] | None = None) -> Self:
|
||||
def __new__(cls, name: str, bases: tuple[type, ...], attrs: dict[str, Any], *, qualified_name: Optional[str] = None, extras: dict[str, Any] | None = None) -> Any:
|
||||
commands: list[Command[ClientT_D]] = []
|
||||
listeners: dict[str, list[str]] = {}
|
||||
|
||||
|
||||
+2
-2
@@ -82,7 +82,7 @@ class WebsocketHandler:
|
||||
|
||||
async def send_payload(self, payload: BasePayload) -> None:
|
||||
if use_msgpack:
|
||||
await self.websocket.send_bytes(msgpack.packb(payload))
|
||||
await self.websocket.send_bytes(msgpack.packb(payload)) # type: ignore
|
||||
else:
|
||||
await self.websocket.send_str(json.dumps(payload))
|
||||
|
||||
@@ -482,7 +482,7 @@ class WebsocketHandler:
|
||||
if use_msgpack:
|
||||
data = cast(bytes, msg.data)
|
||||
|
||||
payload = msgpack.unpackb(data)
|
||||
payload = msgpack.unpackb(data) # type: ignore
|
||||
else:
|
||||
data = cast(str, msg.data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user