mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-16 02:50:48 +00:00
🐛 Fix: State ForwardRef 检测错误 (#2698)
This commit is contained in:
@ -108,7 +108,15 @@ def evaluate_forwardref(
|
||||
|
||||
|
||||
# state
|
||||
T_State: TypeAlias = dict[t.Any, t.Any]
|
||||
# use annotated flag to avoid ForwardRef recreate generic type (py >= 3.11)
|
||||
class StateFlag:
|
||||
def __repr__(self) -> str:
|
||||
return "StateFlag()"
|
||||
|
||||
|
||||
_STATE_FLAG = StateFlag()
|
||||
|
||||
T_State: TypeAlias = t.Annotated[dict[t.Any, t.Any], _STATE_FLAG]
|
||||
"""事件处理状态 State 类型"""
|
||||
|
||||
_DependentCallable: TypeAlias = t.Union[
|
||||
|
Reference in New Issue
Block a user