INNER CODE UNIT · Python

P

hynek/svcs · typing_tests/base.py:116

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


assert_type(con.get(P), P)

# Just make sure it passes even tho it's Any.
p: P = con.get_abstract(P)

con.close()

with contextlib.closing(svcs.Container(reg)) as con:
    ...

with svcs.Container(reg) as con:
    assert_type(con.get(int), int)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…