INNER CODE UNIT · Python

P

hynek/svcs · typing_tests/aiohttp.py:40

class P(Protocol):
    def m(self) -> None: ...


async def func(request: Request) -> None:
    services = await svcs.aiohttp.aget(
        request, int, str, bool, tuple, object, float, list, dict, set, bytes
    )
    assert_type(
        services,
        tuple[int, str, bool, tuple, object, float, list, dict, set, bytes],
    )

    p: P = await svcs.aiohttp.aget_abstract(request, P)

    await svcs.aiohttp.aclose_registry(app)

    assert_type(svcs.aiohttp.svcs_from(request), svcs.Container)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…