Feature: 优先使用 Annotated 的最后一个子依赖 (#2360)

Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
This commit is contained in:
Bryan不可思议
2023-09-14 00:14:45 +08:00
committed by GitHub
parent 0030bf725e
commit 7aaa66c8ba
4 changed files with 37 additions and 3 deletions

View File

@ -79,6 +79,12 @@ async def annotated_prior_depend(
return x
async def annotated_multi_depend(
x: Annotated[Annotated[int, Depends(lambda: 2)], Depends(dependency)]
):
return x
# test sub dependency type mismatch
async def sub_type_mismatch(b: FooBot = Depends(sub_bot)):
return b