diff options
-rw-r--r-- | Lib/test/test_typing.py | 6 | ||||
-rw-r--r-- | Lib/typing.py | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 1e812e1..8681e7e 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -9464,5 +9464,11 @@ class TypeIterationTests(BaseTestCase): self.assertNotIsInstance(type_to_test, collections.abc.Iterable) +def load_tests(loader, tests, pattern): + import doctest + tests.addTests(doctest.DocTestSuite(typing)) + return tests + + if __name__ == '__main__': main() diff --git a/Lib/typing.py b/Lib/typing.py index 3493257..5e3e1f2 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -3404,8 +3404,8 @@ def get_protocol_members(tp: type, /) -> frozenset[str]: >>> class P(Protocol): ... def a(self) -> str: ... ... b: int - >>> get_protocol_members(P) - frozenset({'a', 'b'}) + >>> get_protocol_members(P) == frozenset({'a', 'b'}) + True Raise a TypeError for arguments that are not Protocols. """ |