mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-06 20:16:47 +00:00
✨ Feature: 优先使用 Annotated
的最后一个子依赖 (#2360)
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
This commit is contained in:
@ -26,3 +26,14 @@ async def annotated_arg_str(key: Annotated[str, ArgStr()]) -> str:
|
||||
|
||||
async def annotated_arg_plain_text(key: Annotated[str, ArgPlainText()]) -> str:
|
||||
return key
|
||||
|
||||
|
||||
# test dependency priority
|
||||
async def annotated_prior_arg(key: Annotated[str, ArgStr("foo")] = ArgPlainText()):
|
||||
return key
|
||||
|
||||
|
||||
async def annotated_multi_arg(
|
||||
key: Annotated[Annotated[str, ArgStr("foo")], ArgPlainText()]
|
||||
):
|
||||
return key
|
||||
|
Reference in New Issue
Block a user