File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
Original file line number Diff line number Diff line change @@ -1954,7 +1954,7 @@ without the dedicated syntax, as documented below.
1954
1954
1955
1955
.. doctest ::
1956
1956
1957
- >>> from typing import ParamSpec
1957
+ >>> from typing import ParamSpec, get_origin
1958
1958
>>> P = ParamSpec(" P" )
1959
1959
>>> get_origin(P.args) is P
1960
1960
True
@@ -3059,14 +3059,14 @@ Introspection helpers
3059
3059
3060
3060
Return the set of members defined in a :class: `Protocol `.
3061
3061
3062
- ::
3062
+ .. doctest ::
3063
3063
3064
3064
>>> from typing import Protocol, get_protocol_members
3065
3065
>>> class P (Protocol ):
3066
3066
... def a (self ) -> str : ...
3067
3067
... b: int
3068
- >>> get_protocol_members(P)
3069
- frozenset({'a', 'b'})
3068
+ >>> get_protocol_members(P) == frozenset ({ ' a ' , ' b ' })
3069
+ True
3070
3070
3071
3071
Raise :exc: `TypeError ` for arguments that are not Protocols.
3072
3072
Original file line number Diff line number Diff line change 9
9
import pickle
10
10
import re
11
11
import sys
12
- import warnings
13
- from unittest import TestCase , main , skipUnless , skip
12
+ from unittest import TestCase , main , skip
14
13
from unittest .mock import patch
15
14
from copy import copy , deepcopy
16
15
45
44
import weakref
46
45
import types
47
46
48
- from test .support import import_helper , captured_stderr , cpython_only
47
+ from test .support import captured_stderr , cpython_only
49
48
from test import mod_generics_cache
50
49
from test import _typed_dict_helper
51
50
You can’t perform that action at this time.
0 commit comments