INNER CODE UNIT · Python
afn
hynek/svcs · typing_tests/base.py:181
async def afn(a: str, /, b: int, *, c: bool) -> str:
return "afn"
assert_type(fn, Callable[[svcs.Container], str]) # ty: ignore[type-assertion-failure] -- https://github.com/astral-sh/ty/issues/3697
assert_type(afn, Callable[[svcs.Container], Awaitable[str]]) # ty: ignore[type-assertion-failure]
def f(
fn: Callable[[svcs.Container], str],
afn: Callable[[svcs.Container], Awaitable[str]],
) -> None:
"""
A slightly convoluted check for ty until we have a way to assert.
"""
f(fn, afn)