You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
x.py:12: error: Argument 1 to "sorted" has incompatible type "enumerate[_T]"; expected "Iterable[Tuple[int, _T]]"
x.py:12: error: Argument 1 to "enumerate" has incompatible type "Sequence[_T]"; expected "Iterable[_T]"
I bisected this, it was introduced in 9d5d0e9 (part of #7933, fix for #7863).
When I remove the property and use self._items directly, things seem to be fine.
#7434 looks somewhat similar to me, but I don't think it's the same issue.
The text was updated successfully, but these errors were encountered:
Mypy is correct, you should make the class generic using Generic[_T] base, otherwise these annotations don't make much sense (there is another issue to give a better error message in such cases, see #6520).
The class should inherit from typing.Sequence[_T] to be generic - that is a
superclass of collections.abc.Sequence and seems to work on Python 3.5 as well.
See python/mypy#8064
With 0.750 and this code:
I get:
I bisected this, it was introduced in 9d5d0e9 (part of #7933, fix for #7863).
When I remove the property and use
self._items
directly, things seem to be fine.#7434 looks somewhat similar to me, but I don't think it's the same issue.
The text was updated successfully, but these errors were encountered: