Remove generic from Interaction and ConnectionState

This results in poor ergonomics due to the lack of default generics
for the common case. For most users this ends up in a degraded
experience since the type will resolve to Unknown rather than at the
very least a Client.
This commit is contained in:
Rapptz committed 2022-03-05 05:03:23 -05:00
1 parent aa74238053
commit f7315573aa
4 files changed
+10 -15

No files matched your search

+1 -2
View File
@@ -46,7 +46,6 @@ from .enums import Status
from typing import TYPE_CHECKING, Any, Callable, Tuple, Type, Optional, List, Dict
if TYPE_CHECKING:
from typing_extensions import Self
from .gateway import DiscordWebSocket
from .activity import BaseActivity
from .enums import Status
@@ -317,7 +316,7 @@ class AutoShardedClient(Client):
"""
if TYPE_CHECKING:
_connection: AutoShardedConnectionState[Self]
_connection: AutoShardedConnectionState
def __init__(self, *args: Any, loop: Optional[asyncio.AbstractEventLoop] = None, **kwargs: Any) -> None:
kwargs.pop('shard_id', None)