Skip to content

Commit

Permalink
Refactor type annotations for clarity and consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
vadim-su committed Nov 16, 2024
1 parent ee59b7d commit 89b26cd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion asyncord/client/messages/models/requests/base_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def validate_components(
@classmethod
def inject_embed_attachments(
cls,
attachments: ListAttachmentType | SingleAttachmentType | None | Any, # noqa: ANN401
attachments: ListAttachmentType | SingleAttachmentType | Any | None, # noqa: ANN401
info: ValidationInfo,
) -> list[Any] | None:
"""Inject embed attachments into the data.
Expand Down
4 changes: 2 additions & 2 deletions asyncord/client/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class RestClient:
def __init__(
self,
auth: str | AuthStrategy | None,
ratelimit_strategy: RateLimitStrategy | None | UnsetType = Unset,
ratelimit_strategy: RateLimitStrategy | UnsetType | None = Unset,
session: aiohttp.ClientSession | None = None,
http_client: HttpClient | None = None,
) -> None:
Expand Down Expand Up @@ -102,7 +102,7 @@ def _init_auth_strategy(self, auth: str | AuthStrategy | None) -> None:

def _init_ratelimit_strategy(
self,
ratelimit_strategy: RateLimitStrategy | None | UnsetType = Unset,
ratelimit_strategy: RateLimitStrategy | UnsetType | None = Unset,
) -> None:
"""Initialize the rate limit strategy.
Expand Down
6 changes: 3 additions & 3 deletions asyncord/client_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def create_client_group(
self,
group_name: str,
auth: str | AuthStrategy | None = None,
ratelimit_strategy: RateLimitStrategy | None | UnsetType = Unset,
ratelimit_strategy: RateLimitStrategy | UnsetType | None = Unset,
dispatcher: EventDispatcher | None = None,
http_client: HttpClient | None = None,
) -> ClientGroup:
Expand Down Expand Up @@ -145,7 +145,7 @@ def _build_client_group(
self,
group_name: str,
auth: str | AuthStrategy | None,
ratelimit_strategy: RateLimitStrategy | None | UnsetType,
ratelimit_strategy: RateLimitStrategy | UnsetType | None,
session: aiohttp.ClientSession | None,
dispatcher: EventDispatcher | None,
http_client: HttpClient | None,
Expand Down Expand Up @@ -248,7 +248,7 @@ async def close(self) -> None:
@asynccontextmanager
async def connect(
auth: str | AuthStrategy | None = None,
ratelimit_strategy: RateLimitStrategy | None | UnsetType = Unset,
ratelimit_strategy: RateLimitStrategy | UnsetType | None = Unset,
session: aiohttp.ClientSession | None = None,
dispatcher: EventDispatcher | None = None,
http_client: HttpClient | None = None,
Expand Down
6 changes: 3 additions & 3 deletions tests/gateway/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
def test_init( # noqa: PLR0917, PLR0913
token: BotTokenAuthStrategy | Literal['token'],
session: aiohttp.ClientSession,
conn_data: None | ConnectionData,
conn_data: ConnectionData | None,
intents: Intent,
heartbeat_class: type[Heartbeat] | HeartbeatFactory | None,
dispatcher: None | EventDispatcher,
name: None | Literal['TestClient'],
dispatcher: EventDispatcher | None,
name: Literal['TestClient'] | None,
mocker: MockFixture,
) -> None:
"""Test initializing the GatewayClient.
Expand Down

0 comments on commit 89b26cd

Please sign in to comment.