@@ -30,24 +30,22 @@ def f(
30
30
ordered_dict_bare : typing.OrderedDict,
31
31
ordered_dict_parametrized : typing.OrderedDict[int , str ],
32
32
):
33
- # TODO : revealed: list[Unknown]
34
- reveal_type(list_bare) # revealed: list
33
+ reveal_type(list_bare) # revealed: list[Unknown]
35
34
# TODO : revealed: list[int]
36
- reveal_type(list_parametrized) # revealed: list
35
+ reveal_type(list_parametrized) # revealed: list[Unknown]
37
36
38
37
reveal_type(dict_bare) # revealed: dict[Unknown, Unknown]
39
38
# TODO : revealed: dict[int, str]
40
39
reveal_type(dict_parametrized) # revealed: dict[Unknown, Unknown]
41
40
42
- # TODO : revealed: set[Unknown]
43
- reveal_type(set_bare) # revealed: set
41
+ reveal_type(set_bare) # revealed: set[Unknown]
44
42
# TODO : revealed: set[int]
45
- reveal_type(set_parametrized) # revealed: set
43
+ reveal_type(set_parametrized) # revealed: set[Unknown]
46
44
47
45
# TODO : revealed: frozenset[Unknown]
48
- reveal_type(frozen_set_bare) # revealed: frozenset
46
+ reveal_type(frozen_set_bare) # revealed: frozenset[Unknown]
49
47
# TODO : revealed: frozenset[str]
50
- reveal_type(frozen_set_parametrized) # revealed: frozenset
48
+ reveal_type(frozen_set_parametrized) # revealed: frozenset[Unknown]
51
49
52
50
reveal_type(chain_map_bare) # revealed: ChainMap[Unknown, Unknown]
53
51
# TODO : revealed: ChainMap[str, int]
@@ -61,10 +59,9 @@ def f(
61
59
# TODO : revealed: defaultdict[str, int]
62
60
reveal_type(default_dict_parametrized) # revealed: defaultdict[Unknown, Unknown]
63
61
64
- # TODO : revealed: deque[Unknown]
65
- reveal_type(deque_bare) # revealed: deque
62
+ reveal_type(deque_bare) # revealed: deque[Unknown]
66
63
# TODO : revealed: deque[str]
67
- reveal_type(deque_parametrized) # revealed: deque
64
+ reveal_type(deque_parametrized) # revealed: deque[Unknown]
68
65
69
66
reveal_type(ordered_dict_bare) # revealed: OrderedDict[Unknown, Unknown]
70
67
# TODO : revealed: OrderedDict[int, str]
@@ -84,26 +81,23 @@ import typing
84
81
85
82
class ListSubclass (typing .List ): ...
86
83
87
- # TODO : generic protocols
88
- # revealed: tuple[<class 'ListSubclass'>, <class 'list'>, <class 'MutableSequence'>, <class 'Sequence'>, <class 'Reversible'>, <class 'Collection'>, <class 'Iterable'>, <class 'Container'>, @Todo(`Protocol[]` subscript), typing.Generic, <class 'object'>]
84
+ # revealed: tuple[<class 'ListSubclass'>, <class 'list[Unknown]'>, <class 'MutableSequence[Unknown]'>, <class 'Sequence[Unknown]'>, <class 'Reversible[Unknown]'>, <class 'Collection[Unknown]'>, <class 'Iterable[Unknown]'>, <class 'Container[Unknown]'>, typing.Protocol[_T_co], typing.Generic[_T_co], <class 'object'>]
89
85
reveal_type(ListSubclass.__mro__ )
90
86
91
87
class DictSubclass (typing .Dict ): ...
92
88
93
- # TODO : generic protocols
94
- # revealed: tuple[<class 'DictSubclass'>, <class 'dict[Unknown, Unknown]'>, <class 'MutableMapping[Unknown, Unknown]'>, <class 'Mapping[Unknown, Unknown]'>, <class 'Collection'>, <class 'Iterable'>, <class 'Container'>, @Todo(` Protocol[]` subscript) , typing.Generic, typing.Generic[_KT, _VT_co], <class 'object'>]
89
+ # TODO : should not have multiple `Generic[]` elements
90
+ # revealed: tuple[<class 'DictSubclass'>, <class 'dict[Unknown, Unknown]'>, <class 'MutableMapping[Unknown, Unknown]'>, <class 'Mapping[Unknown, Unknown]'>, <class 'Collection[Unknown] '>, <class 'Iterable[Unknown] '>, <class 'Container[Unknown] '>, typing. Protocol[_T_co] , typing.Generic[_T_co] , typing.Generic[_KT, _VT_co], <class 'object'>]
95
91
reveal_type(DictSubclass.__mro__ )
96
92
97
93
class SetSubclass (typing .Set ): ...
98
94
99
- # TODO : generic protocols
100
- # revealed: tuple[<class 'SetSubclass'>, <class 'set'>, <class 'MutableSet'>, <class 'AbstractSet'>, <class 'Collection'>, <class 'Iterable'>, <class 'Container'>, @Todo(`Protocol[]` subscript), typing.Generic, <class 'object'>]
95
+ # revealed: tuple[<class 'SetSubclass'>, <class 'set[Unknown]'>, <class 'MutableSet[Unknown]'>, <class 'AbstractSet[Unknown]'>, <class 'Collection[Unknown]'>, <class 'Iterable[Unknown]'>, <class 'Container[Unknown]'>, typing.Protocol[_T_co], typing.Generic[_T_co], <class 'object'>]
101
96
reveal_type(SetSubclass.__mro__ )
102
97
103
98
class FrozenSetSubclass (typing .FrozenSet ): ...
104
99
105
- # TODO : generic protocols
106
- # revealed: tuple[<class 'FrozenSetSubclass'>, <class 'frozenset'>, <class 'AbstractSet'>, <class 'Collection'>, <class 'Iterable'>, <class 'Container'>, @Todo(`Protocol[]` subscript), typing.Generic, <class 'object'>]
100
+ # revealed: tuple[<class 'FrozenSetSubclass'>, <class 'frozenset[Unknown]'>, <class 'AbstractSet[Unknown]'>, <class 'Collection[Unknown]'>, <class 'Iterable[Unknown]'>, <class 'Container[Unknown]'>, typing.Protocol[_T_co], typing.Generic[_T_co], <class 'object'>]
107
101
reveal_type(FrozenSetSubclass.__mro__ )
108
102
109
103
# ###################
@@ -112,31 +106,30 @@ reveal_type(FrozenSetSubclass.__mro__)
112
106
113
107
class ChainMapSubclass (typing .ChainMap ): ...
114
108
115
- # TODO : generic protocols
116
- # revealed: tuple[<class 'ChainMapSubclass'>, <class 'ChainMap[Unknown, Unknown]'>, <class 'MutableMapping[Unknown, Unknown]'>, <class 'Mapping[Unknown, Unknown]'>, <class 'Collection'>, <class 'Iterable'>, <class 'Container'>, @Todo(` Protocol[]` subscript) , typing.Generic, typing.Generic[_KT, _VT_co], <class 'object'>]
109
+ # TODO : should not have multiple `Generic[]` elements
110
+ # revealed: tuple[<class 'ChainMapSubclass'>, <class 'ChainMap[Unknown, Unknown]'>, <class 'MutableMapping[Unknown, Unknown]'>, <class 'Mapping[Unknown, Unknown]'>, <class 'Collection[Unknown] '>, <class 'Iterable[Unknown] '>, <class 'Container[Unknown] '>, typing. Protocol[_T_co] , typing.Generic[_T_co] , typing.Generic[_KT, _VT_co], <class 'object'>]
117
111
reveal_type(ChainMapSubclass.__mro__ )
118
112
119
113
class CounterSubclass (typing .Counter ): ...
120
114
121
- # TODO : Should be (CounterSubclass, Counter, dict, MutableMapping, Mapping, Collection, Sized, Iterable, Container, Generic, object )
122
- # revealed: tuple[<class 'CounterSubclass'>, <class 'Counter[Unknown]'>, <class 'dict[Unknown, int]'>, <class 'MutableMapping[Unknown, int]'>, <class 'Mapping[Unknown, int]'>, <class 'Collection'>, <class 'Iterable'>, <class 'Container'>, @Todo(` Protocol[]` subscript) , typing.Generic, typing.Generic[_KT, _VT_co], typing.Generic[_T], <class 'object'>]
115
+ # TODO : Should have one `Generic[]` element, not three(! )
116
+ # revealed: tuple[<class 'CounterSubclass'>, <class 'Counter[Unknown]'>, <class 'dict[Unknown, int]'>, <class 'MutableMapping[Unknown, int]'>, <class 'Mapping[Unknown, int]'>, <class 'Collection[Unknown] '>, <class 'Iterable[Unknown] '>, <class 'Container[Unknown] '>, typing. Protocol[_T_co] , typing.Generic[_T_co] , typing.Generic[_KT, _VT_co], typing.Generic[_T], <class 'object'>]
123
117
reveal_type(CounterSubclass.__mro__ )
124
118
125
119
class DefaultDictSubclass (typing .DefaultDict ): ...
126
120
127
- # TODO : Should be (DefaultDictSubclass, defaultdict, dict, MutableMapping, Mapping, Collection, Sized, Iterable, Container, Generic, object)
128
- # revealed: tuple[<class 'DefaultDictSubclass'>, <class 'defaultdict[Unknown, Unknown]'>, <class 'dict[Unknown, Unknown]'>, <class 'MutableMapping[Unknown, Unknown]'>, <class 'Mapping[Unknown, Unknown]'>, <class 'Collection'>, <class 'Iterable'>, <class 'Container'>, @Todo(` Protocol[]` subscript) , typing.Generic, typing.Generic[_KT, _VT_co], <class 'object'>]
121
+ # TODO : Should not have multiple ` Generic[]` elements
122
+ # revealed: tuple[<class 'DefaultDictSubclass'>, <class 'defaultdict[Unknown, Unknown]'>, <class 'dict[Unknown, Unknown]'>, <class 'MutableMapping[Unknown, Unknown]'>, <class 'Mapping[Unknown, Unknown]'>, <class 'Collection[Unknown] '>, <class 'Iterable[Unknown] '>, <class 'Container[Unknown] '>, typing. Protocol[_T_co] , typing.Generic[_T_co] , typing.Generic[_KT, _VT_co], <class 'object'>]
129
123
reveal_type(DefaultDictSubclass.__mro__ )
130
124
131
125
class DequeSubclass (typing .Deque ): ...
132
126
133
- # TODO : generic protocols
134
- # revealed: tuple[<class 'DequeSubclass'>, <class 'deque'>, <class 'MutableSequence'>, <class 'Sequence'>, <class 'Reversible'>, <class 'Collection'>, <class 'Iterable'>, <class 'Container'>, @Todo(`Protocol[]` subscript), typing.Generic, <class 'object'>]
127
+ # revealed: tuple[<class 'DequeSubclass'>, <class 'deque[Unknown]'>, <class 'MutableSequence[Unknown]'>, <class 'Sequence[Unknown]'>, <class 'Reversible[Unknown]'>, <class 'Collection[Unknown]'>, <class 'Iterable[Unknown]'>, <class 'Container[Unknown]'>, typing.Protocol[_T_co], typing.Generic[_T_co], <class 'object'>]
135
128
reveal_type(DequeSubclass.__mro__ )
136
129
137
130
class OrderedDictSubclass (typing .OrderedDict ): ...
138
131
139
- # TODO : Should be (OrderedDictSubclass, OrderedDict, dict, MutableMapping, Mapping, Collection, Sized, Iterable, Container, Generic, object)
140
- # revealed: tuple[<class 'OrderedDictSubclass'>, <class 'OrderedDict[Unknown, Unknown]'>, <class 'dict[Unknown, Unknown]'>, <class 'MutableMapping[Unknown, Unknown]'>, <class 'Mapping[Unknown, Unknown]'>, <class 'Collection'>, <class 'Iterable'>, <class 'Container'>, @Todo(` Protocol[]` subscript) , typing.Generic, typing.Generic[_KT, _VT_co], <class 'object'>]
132
+ # TODO : Should not have multiple ` Generic[]` elements
133
+ # revealed: tuple[<class 'OrderedDictSubclass'>, <class 'OrderedDict[Unknown, Unknown]'>, <class 'dict[Unknown, Unknown]'>, <class 'MutableMapping[Unknown, Unknown]'>, <class 'Mapping[Unknown, Unknown]'>, <class 'Collection[Unknown] '>, <class 'Iterable[Unknown] '>, <class 'Container[Unknown] '>, typing. Protocol[_T_co] , typing.Generic[_T_co] , typing.Generic[_KT, _VT_co], <class 'object'>]
141
134
reveal_type(OrderedDictSubclass.__mro__ )
142
135
```
0 commit comments