diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2023-11-03 12:23:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-03 12:23:33 (GMT) |
commit | ccc8caa8587103c4ccf617ba106cef63344504dd (patch) | |
tree | e82005f618007348b1a7aa2e46e24b99bc4fa8f6 /Doc | |
parent | 24ddaee5ca112063b460e72d31b3da551a02bf0a (diff) | |
download | cpython-ccc8caa8587103c4ccf617ba106cef63344504dd.zip cpython-ccc8caa8587103c4ccf617ba106cef63344504dd.tar.gz cpython-ccc8caa8587103c4ccf617ba106cef63344504dd.tar.bz2 |
gh-111681: minor fixes to typing doctests; remove unused imports in `test_typing` (#111682)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/typing.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index bdff2bb..f82f535 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -1954,7 +1954,7 @@ without the dedicated syntax, as documented below. .. doctest:: - >>> from typing import ParamSpec + >>> from typing import ParamSpec, get_origin >>> P = ParamSpec("P") >>> get_origin(P.args) is P True @@ -3059,14 +3059,14 @@ Introspection helpers Return the set of members defined in a :class:`Protocol`. - :: + .. doctest:: >>> from typing import Protocol, get_protocol_members >>> 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 :exc:`TypeError` for arguments that are not Protocols. |