Skip to content

Commit 63e5a5b

Browse files
committed
test: add a test with a sub-protocol
1 parent 8c7a1e9 commit 63e5a5b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/test/test_typing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4557,7 +4557,6 @@ class Commentable(Protocol):
45574557
def test_isinstance_with_deferred_evaluation_of_annotations(self):
45584558
@runtime_checkable
45594559
class P(Protocol):
4560-
x: undefined | int
45614560
def meth(self):
45624561
...
45634562

@@ -4573,6 +4572,11 @@ def __init__(self):
45734572
def meth(self):
45744573
...
45754574

4575+
class SubProtocol(P, Protocol):
4576+
meth: undefined
4577+
4578+
4579+
self.assertTrue(issubclass(SubProtocol, P))
45764580
self.assertFalse(isinstance(DeferredClass(), P))
45774581
self.assertTrue(isinstance(DeferredClassImplementingP(), P))
45784582

0 commit comments

Comments
 (0)