Skip to content

Commit

Permalink
make ordereddict generics the wrong way around
Browse files Browse the repository at this point in the history
  • Loading branch information
KotlinIsland committed Sep 20, 2021
1 parent 0d11717 commit 9c8b4d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stdlib/collections/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ class _OrderedDictKeysView(_dict_keys[_KT_co, _VT_co], Reversible[_KT_co]):
class _OrderedDictItemsView(_dict_items[_KT_co, _VT_co], Reversible[Tuple[_KT_co, _VT_co]]):
def __reversed__(self) -> Iterator[Tuple[_KT_co, _VT_co]]: ...

class _OrderedDictValuesView(_dict_values[_VT_co, _KT_co], Reversible[_VT_co], Generic[_KT_co, _VT_co]):
# The generics are the wrong way around because of a mypy limitation
# https://github.com/python/mypy/issues/11138
class _OrderedDictValuesView(_dict_values[_VT_co, _KT_co], Reversible[_VT_co], Generic[_VT_co, _KT_co]):
def __reversed__(self) -> Iterator[_VT_co]: ...

class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
Expand Down

0 comments on commit 9c8b4d0

Please sign in to comment.