@@ -30,19 +30,17 @@ def f(
3030 ordered_dict_bare : typing.OrderedDict,
3131 ordered_dict_parametrized : typing.OrderedDict[int , str ],
3232):
33- # TODO : revealed: list[Unknown]
34- reveal_type(list_bare) # revealed: list
33+ reveal_type(list_bare) # revealed: list[Unknown]
3534 # TODO : revealed: list[int]
36- reveal_type(list_parametrized) # revealed: list
35+ reveal_type(list_parametrized) # revealed: list[Unknown]
3736
3837 reveal_type(dict_bare) # revealed: dict[Unknown, Unknown]
3938 # TODO : revealed: dict[int, str]
4039 reveal_type(dict_parametrized) # revealed: dict[Unknown, Unknown]
4140
42- # TODO : revealed: set[Unknown]
43- reveal_type(set_bare) # revealed: set
41+ reveal_type(set_bare) # revealed: set[Unknown]
4442 # TODO : revealed: set[int]
45- reveal_type(set_parametrized) # revealed: set
43+ reveal_type(set_parametrized) # revealed: set[Unknown]
4644
4745 # TODO : revealed: frozenset[Unknown]
4846 reveal_type(frozen_set_bare) # revealed: frozenset
@@ -61,10 +59,9 @@ def f(
6159 # TODO : revealed: defaultdict[str, int]
6260 reveal_type(default_dict_parametrized) # revealed: defaultdict[Unknown, Unknown]
6361
64- # TODO : revealed: deque[Unknown]
65- reveal_type(deque_bare) # revealed: deque
62+ reveal_type(deque_bare) # revealed: deque[Unknown]
6663 # TODO : revealed: deque[str]
67- reveal_type(deque_parametrized) # revealed: deque
64+ reveal_type(deque_parametrized) # revealed: deque[Unknown]
6865
6966 reveal_type(ordered_dict_bare) # revealed: OrderedDict[Unknown, Unknown]
7067 # TODO : revealed: OrderedDict[int, str]
@@ -84,20 +81,18 @@ import typing
8481
8582class ListSubclass (typing .List ): ...
8683
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]]
8985reveal_type(ListSubclass.__mro__ )
9086
9187class DictSubclass (typing .Dict ): ...
9288
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]]
9591reveal_type(DictSubclass.__mro__ )
9692
9793class SetSubclass (typing .Set ): ...
9894
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]]
10196reveal_type(SetSubclass.__mro__ )
10297
10398class FrozenSetSubclass (typing .FrozenSet ): ...
@@ -112,31 +107,30 @@ reveal_type(FrozenSetSubclass.__mro__)
112107
113108class ChainMapSubclass (typing .ChainMap ): ...
114109
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]]
117112reveal_type(ChainMapSubclass.__mro__ )
118113
119114class CounterSubclass (typing .Counter ): ...
120115
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]]
123118reveal_type(CounterSubclass.__mro__ )
124119
125120class DefaultDictSubclass (typing .DefaultDict ): ...
126121
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]]
129124reveal_type(DefaultDictSubclass.__mro__ )
130125
131126class DequeSubclass (typing .Deque ): ...
132127
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]]
135129reveal_type(DequeSubclass.__mro__ )
136130
137131class OrderedDictSubclass (typing .OrderedDict ): ...
138132
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]]
141135reveal_type(OrderedDictSubclass.__mro__ )
142136```
0 commit comments