mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-16 19:11:00 +00:00
🐛 fix missing escape in builtin plugin #117
This commit is contained in:
@ -17,17 +17,19 @@
|
||||
.. _typing:
|
||||
https://docs.python.org/3/library/typing.html
|
||||
"""
|
||||
|
||||
from typing import Any, Dict, Union, TypeVar, Protocol, overload, Optional, Callable, NoReturn, Awaitable, TYPE_CHECKING
|
||||
from collections.abc import Callable as BaseCallable
|
||||
from typing import Any, Dict, Union, TypeVar, Optional, Callable, NoReturn, Awaitable, TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from nonebot.adapters import Bot, Event
|
||||
from nonebot.matcher import Matcher
|
||||
|
||||
T_Wrapped = TypeVar("T_Wrapped", bound=BaseCallable)
|
||||
|
||||
|
||||
def overrides(InterfaceClass: object):
|
||||
|
||||
def overrider(func: Callable) -> Callable:
|
||||
def overrider(func: T_Wrapped) -> T_Wrapped:
|
||||
assert func.__name__ in dir(
|
||||
InterfaceClass), f"Error method: {func.__name__}"
|
||||
return func
|
||||
|
Reference in New Issue
Block a user