INNER CODE UNIT · Python

ctx

hynek/svcs · typing_tests/base.py:134

async def ctx() -> None:
    async with contextlib.aclosing(svcs.Container(reg)):
        ...

    async with contextlib.aclosing(svcs.Registry()):
        ...


# Multiple factories for same type:
class S1(str):
    pass


S2 = NewType("S2", str)
S3 = Annotated[str, "S3"]


reg.register_value(S1, "foo")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…