@@ -30,19 +30,17 @@ 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
46
reveal_type(frozen_set_bare) # revealed: frozenset
@@ -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,20 +81,18 @@ import typing
84
81
85
82
class ListSubclass (typing .List ): ...
86
83
87
- # TODO : generic protocols
88
- # revealed: tuple[Literal[ListSubclass], Literal[list], Literal[MutableSequence], Literal[Sequence], Literal[Reversible], Literal[Collection], Literal[Iterable], Literal[Container], @Todo(`Protocol[]` subscript), typing.Generic, Literal[object]]
84
+ # revealed: tuple[Literal[ListSubclass], Literal[list[Unknown]], Literal[MutableSequence[_T]], Literal[Sequence[_T]], Literal[Reversible[_T_co]], Literal[Collection[_T_co]], Literal[Iterable[_T_co]], Literal[Container[_T_co]], typing.Protocol[_T_co], typing.Generic[_T_co], Literal[object]]
89
85
reveal_type(ListSubclass.__mro__ )
90
86
91
87
class DictSubclass (typing .Dict ): ...
92
88
93
- # TODO : generic protocols
94
- # revealed: tuple[Literal[DictSubclass], Literal[dict[Unknown, Unknown]], Literal[MutableMapping[_KT, _VT]], Literal[Mapping[_KT, _VT]], Literal[Collection] , Literal[Iterable] , Literal[Container], @Todo(` Protocol[]` subscript) , typing.Generic, typing.Generic[_KT, _VT_co], Literal[object]]
89
+ # TODO : should not have `Generic` multiple times
90
+ # revealed: tuple[Literal[DictSubclass], Literal[dict[Unknown, Unknown]], Literal[MutableMapping[_KT, _VT]], Literal[Mapping[_KT, _VT]], Literal[Collection[_KT]] , Literal[Iterable[_T_co]] , Literal[Container[_T_co]], typing. Protocol[_T_co] , typing.Generic[_T_co] , typing.Generic[_KT, _VT_co], Literal[object]]
95
91
reveal_type(DictSubclass.__mro__ )
96
92
97
93
class SetSubclass (typing .Set ): ...
98
94
99
- # TODO : generic protocols
100
- # revealed: tuple[Literal[SetSubclass], Literal[set], Literal[MutableSet], Literal[AbstractSet], Literal[Collection], Literal[Iterable], Literal[Container], @Todo(`Protocol[]` subscript), typing.Generic, Literal[object]]
95
+ # revealed: tuple[Literal[SetSubclass], Literal[set[Unknown]], Literal[MutableSet[_T]], Literal[AbstractSet[_T]], Literal[Collection[_T_co]], Literal[Iterable[_T_co]], Literal[Container[_T_co]], typing.Protocol[_T_co], typing.Generic[_T_co], Literal[object]]
101
96
reveal_type(SetSubclass.__mro__ )
102
97
103
98
class FrozenSetSubclass (typing .FrozenSet ): ...
@@ -112,31 +107,30 @@ reveal_type(FrozenSetSubclass.__mro__)
112
107
113
108
class ChainMapSubclass (typing .ChainMap ): ...
114
109
115
- # TODO : generic protocols
116
- # revealed: tuple[Literal[ChainMapSubclass], Literal[ChainMap[Unknown, Unknown]], Literal[MutableMapping[_KT, _VT]], Literal[Mapping[_KT, _VT]], Literal[Collection] , Literal[Iterable] , Literal[Container], @Todo(` Protocol[]` subscript) , typing.Generic, typing.Generic[_KT, _VT_co], Literal[object]]
110
+ # TODO : should not have `Generic` multiple times
111
+ # revealed: tuple[Literal[ChainMapSubclass], Literal[ChainMap[Unknown, Unknown]], Literal[MutableMapping[_KT, _VT]], Literal[Mapping[_KT, _VT]], Literal[Collection[_KT]] , Literal[Iterable[_T_co]] , Literal[Container[_T_co]], typing. Protocol[_T_co] , typing.Generic[_T_co] , typing.Generic[_KT, _VT_co], Literal[object]]
117
112
reveal_type(ChainMapSubclass.__mro__ )
118
113
119
114
class CounterSubclass (typing .Counter ): ...
120
115
121
- # TODO : Should be (CounterSubclass, Counter, dict, MutableMapping, Mapping, Collection, Sized, Iterable, Container, Generic, object)
122
- # revealed: tuple[Literal[CounterSubclass], Literal[Counter[Unknown]], Literal[dict[_T, int]], Literal[MutableMapping[_KT, _VT]], Literal[Mapping[_KT, _VT]], Literal[Collection] , Literal[Iterable] , Literal[Container], @Todo(` Protocol[]` subscript) , typing.Generic, typing.Generic[_KT, _VT_co], typing.Generic[_T], Literal[object]]
116
+ # TODO : Should not have ` Generic` multiple times
117
+ # revealed: tuple[Literal[CounterSubclass], Literal[Counter[Unknown]], Literal[dict[_T, int]], Literal[MutableMapping[_KT, _VT]], Literal[Mapping[_KT, _VT]], Literal[Collection[_KT]] , Literal[Iterable[_T_co]] , Literal[Container[_T_co]], typing. Protocol[_T_co] , typing.Generic[_T_co] , typing.Generic[_KT, _VT_co], typing.Generic[_T], Literal[object]]
123
118
reveal_type(CounterSubclass.__mro__ )
124
119
125
120
class DefaultDictSubclass (typing .DefaultDict ): ...
126
121
127
- # TODO : Should be (DefaultDictSubclass, defaultdict, dict, MutableMapping, Mapping, Collection, Sized, Iterable, Container, Generic, object)
128
- # revealed: tuple[Literal[DefaultDictSubclass], Literal[defaultdict[Unknown, Unknown]], Literal[dict[_KT, _VT]], Literal[MutableMapping[_KT, _VT]], Literal[Mapping[_KT, _VT]], Literal[Collection] , Literal[Iterable] , Literal[Container], @Todo(` Protocol[]` subscript) , typing.Generic, typing.Generic[_KT, _VT_co], Literal[object]]
122
+ # TODO : Should not have ` Generic` multiple times
123
+ # revealed: tuple[Literal[DefaultDictSubclass], Literal[defaultdict[Unknown, Unknown]], Literal[dict[_KT, _VT]], Literal[MutableMapping[_KT, _VT]], Literal[Mapping[_KT, _VT]], Literal[Collection[_KT]] , Literal[Iterable[_T_co]] , Literal[Container[_T_co]], typing. Protocol[_T_co] , typing.Generic[_T_co] , typing.Generic[_KT, _VT_co], Literal[object]]
129
124
reveal_type(DefaultDictSubclass.__mro__ )
130
125
131
126
class DequeSubclass (typing .Deque ): ...
132
127
133
- # TODO : generic protocols
134
- # revealed: tuple[Literal[DequeSubclass], Literal[deque], Literal[MutableSequence], Literal[Sequence], Literal[Reversible], Literal[Collection], Literal[Iterable], Literal[Container], @Todo(`Protocol[]` subscript), typing.Generic, Literal[object]]
128
+ # revealed: tuple[Literal[DequeSubclass], Literal[deque[Unknown]], Literal[MutableSequence[_T]], Literal[Sequence[_T]], Literal[Reversible[_T_co]], Literal[Collection[_T_co]], Literal[Iterable[_T_co]], Literal[Container[_T_co]], typing.Protocol[_T_co], typing.Generic[_T_co], Literal[object]]
135
129
reveal_type(DequeSubclass.__mro__ )
136
130
137
131
class OrderedDictSubclass (typing .OrderedDict ): ...
138
132
139
- # TODO : Should be (OrderedDictSubclass, OrderedDict, dict, MutableMapping, Mapping, Collection, Sized, Iterable, Container, Generic, object)
140
- # revealed: tuple[Literal[OrderedDictSubclass], Literal[OrderedDict[Unknown, Unknown]], Literal[dict[_KT, _VT]], Literal[MutableMapping[_KT, _VT]], Literal[Mapping[_KT, _VT]], Literal[Collection] , Literal[Iterable] , Literal[Container], @Todo(` Protocol[]` subscript) , typing.Generic, typing.Generic[_KT, _VT_co], Literal[object]]
133
+ # TODO : Should not have multiple ` Generic` bases
134
+ # revealed: tuple[Literal[OrderedDictSubclass], Literal[OrderedDict[Unknown, Unknown]], Literal[dict[_KT, _VT]], Literal[MutableMapping[_KT, _VT]], Literal[Mapping[_KT, _VT]], Literal[Collection[_KT]] , Literal[Iterable[_T_co]] , Literal[Container[_T_co]], typing. Protocol[_T_co] , typing.Generic[_T_co] , typing.Generic[_KT, _VT_co], Literal[object]]
141
135
reveal_type(OrderedDictSubclass.__mro__ )
142
136
```
0 commit comments