Skip to content

Commit 9cff22c

Browse files
authored
make isinstance protocols example runnable (#10038)
1 parent 090bfa9 commit 9cff22c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/source/protocols.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@ support for basic runtime structural checks:
429429
def __init__(self) -> None:
430430
self.handles = 1
431431
432+
def use(handles: int) -> None: ...
433+
432434
mug = Mug()
433435
if isinstance(mug, Portable):
434436
use(mug.handles) # Works statically and at runtime

0 commit comments

Comments
 (0)