improve dependency cache

This commit is contained in:
yanyongyu
2021-12-16 23:22:25 +08:00
parent fe69735ca0
commit 3d762fcbab
15 changed files with 162 additions and 100 deletions

View File

@ -17,7 +17,7 @@
.. _typing:
https://docs.python.org/3/library/typing.html
"""
from asyncio import Task
from typing import (
TYPE_CHECKING,
Any,
@ -32,7 +32,6 @@ from typing import (
)
if TYPE_CHECKING:
from nonebot.utils import CacheDict
from nonebot.adapters import Bot, Event
from nonebot.permission import Permission
@ -250,3 +249,9 @@ T_PermissionUpdater = Callable[..., Union["Permission", Awaitable["Permission"]]
PermissionUpdater 在 Matcher.pause, Matcher.reject 时被运行,用于更新会话对象权限。默认会更新为当前事件的触发对象。
"""
T_DependencyCache = Dict[Callable[..., Any], Task[Any]]
"""
:类型: ``Dict[Callable[..., Any], Task[Any]]``
:说明:
依赖缓存, 用于存储依赖函数的返回值
"""