Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6e909e1

Browse filesBrowse files
sobolevnAlexWaygood
authored andcommitted
pythongh-111681: minor fixes to typing doctests; remove unused imports in test_typing (python#111682)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
1 parent edfc396 commit 6e909e1
Copy full SHA for 6e909e1

File tree

Expand file treeCollapse file tree

2 files changed

+6
-7
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-7
lines changed

‎Doc/library/typing.rst

Copy file name to clipboardExpand all lines: Doc/library/typing.rst
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ without the dedicated syntax, as documented below.
19541954

19551955
.. doctest::
19561956

1957-
>>> from typing import ParamSpec
1957+
>>> from typing import ParamSpec, get_origin
19581958
>>> P = ParamSpec("P")
19591959
>>> get_origin(P.args) is P
19601960
True
@@ -3059,14 +3059,14 @@ Introspection helpers
30593059

30603060
Return the set of members defined in a :class:`Protocol`.
30613061

3062-
::
3062+
.. doctest::
30633063

30643064
>>> from typing import Protocol, get_protocol_members
30653065
>>> class P(Protocol):
30663066
... def a(self) -> str: ...
30673067
... b: int
3068-
>>> get_protocol_members(P)
3069-
frozenset({'a', 'b'})
3068+
>>> get_protocol_members(P) == frozenset({'a', 'b'})
3069+
True
30703070

30713071
Raise :exc:`TypeError` for arguments that are not Protocols.
30723072

‎Lib/test/test_typing.py

Copy file name to clipboardExpand all lines: Lib/test/test_typing.py
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
import pickle
1010
import re
1111
import sys
12-
import warnings
13-
from unittest import TestCase, main, skipUnless, skip
12+
from unittest import TestCase, main, skip
1413
from unittest.mock import patch
1514
from copy import copy, deepcopy
1615

@@ -45,7 +44,7 @@
4544
import weakref
4645
import types
4746

48-
from test.support import import_helper, captured_stderr, cpython_only
47+
from test.support import captured_stderr, cpython_only
4948
from test import mod_generics_cache
5049
from test import _typed_dict_helper
5150

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.