mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Typing improvements
This commit is contained in:
parent
f506ea1631
commit
cd3dc7c3cd
2 changed files with 4 additions and 4 deletions
|
|
@ -6,7 +6,7 @@ import signal
|
||||||
import warnings
|
import warnings
|
||||||
from asyncio import CancelledError, Event, Future, Lock
|
from asyncio import CancelledError, Event, Future, Lock
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from typing import Any, AsyncGenerator, Dict, List, Optional, Union
|
from typing import Any, AsyncGenerator, Dict, List, Optional, Set, Union
|
||||||
|
|
||||||
from .. import loggers
|
from .. import loggers
|
||||||
from ..client.bot import Bot
|
from ..client.bot import Bot
|
||||||
|
|
@ -95,7 +95,7 @@ class Dispatcher(Router):
|
||||||
self._running_lock = Lock()
|
self._running_lock = Lock()
|
||||||
self._stop_signal: Optional[Event] = None
|
self._stop_signal: Optional[Event] = None
|
||||||
self._stopped_signal: Optional[Event] = None
|
self._stopped_signal: Optional[Event] = None
|
||||||
self._handle_update_tasks = set()
|
self._handle_update_tasks: Set[asyncio.Task[Any]] = set()
|
||||||
|
|
||||||
def __getitem__(self, item: str) -> Any:
|
def __getitem__(self, item: str) -> Any:
|
||||||
return self.workflow_data[item]
|
return self.workflow_data[item]
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import asyncio
|
||||||
import secrets
|
import secrets
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from asyncio import Transport
|
from asyncio import Transport
|
||||||
from typing import Any, Awaitable, Callable, Dict, Optional, Tuple, cast
|
from typing import Any, Awaitable, Callable, Dict, Optional, Set, Tuple, cast
|
||||||
|
|
||||||
from aiohttp import MultipartWriter, web
|
from aiohttp import MultipartWriter, web
|
||||||
from aiohttp.abc import Application
|
from aiohttp.abc import Application
|
||||||
|
|
@ -98,7 +98,7 @@ class BaseRequestHandler(ABC):
|
||||||
self.dispatcher = dispatcher
|
self.dispatcher = dispatcher
|
||||||
self.handle_in_background = handle_in_background
|
self.handle_in_background = handle_in_background
|
||||||
self.data = data
|
self.data = data
|
||||||
self._background_feed_update_tasks = set()
|
self._background_feed_update_tasks: Set[asyncio.Task[Any]] = set()
|
||||||
|
|
||||||
def register(self, app: Application, /, path: str, **kwargs: Any) -> None:
|
def register(self, app: Application, /, path: str, **kwargs: Any) -> None:
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue