Revert "Remove redundant inheritances from Iterator in itertools (#12816)"#12853
Revert "Remove redundant inheritances from Iterator in itertools (#12816)"#12853tungol wants to merge 1 commit intopython:mainfrom
Conversation
…hon#12816)" This reverts commit 281dd35.
|
No problem; I wouldn't want changes to go through that haven't gotten the vetting that they need. |
|
Diff from mypy_primer, showing the effect of this PR on open source code: python-chess (https://github.com/niklasf/python-chess)
- chess/pgn.py:194: error: No overload variant of "iter" matches argument type "object" [call-overload]
- chess/pgn.py:194: note: Possible overload variants:
- chess/pgn.py:194: note: def [_SupportsNextT: SupportsNext[Any]] iter(SupportsIter[_SupportsNextT], /) -> _SupportsNextT
- chess/pgn.py:194: note: def [_T] iter(_GetItemIterable[_T], /) -> Iterator[_T]
- chess/pgn.py:194: note: def [_T] iter(Callable[[], _T | None], None, /) -> Iterator[_T]
- chess/pgn.py:194: note: def [_T] iter(Callable[[], _T], object, /) -> Iterator[_T]
jax (https://github.com/google/jax)
- jax/_src/numpy/linalg.py:2087: error: Unused "type: ignore" comment [unused-ignore]
xarray (https://github.com/pydata/xarray)
- xarray/core/dataset.py: note: In function "_get_chunk":
- xarray/core/dataset.py:280: error: Argument 1 to "difference" of "set" has incompatible type "object"; expected "Iterable[Any]" [arg-type]
- xarray/core/dataset.py: note: At top level:
|
|
Given that mypy 1.12 uses unions for ternary, we could try this again after we update typeshed to mypy 1.12: https://github.com/python/typeshed/blob/main/requirements-tests.txt#L3 |
So, update first and see whether this helps? This doesn't seem time critical, as I don't think mypy 1.13 is going to be released in the next few days. |
|
Funnily enough I think there will be a mypy 1.13 in the next few days, but it won't include a typeshed sync so we're fine :-) So no time pressure, but would be good to confirm against mypy_primer. Merging this revert might still be the easiest way to do that. Or I guess seeing what it looks like on next typeshed sync to mypy |
|
I kicked off a sync in python/mypy#17994 |
|
Looks like 1.12 does fix the issue with ternary expressions. The change for jax is still there. I think that jax is surfacing the same underlying issue as ibis and psycopg in #12851 (comment) ; They all have the form I don't have an opinion myself as to whether this should or shouldn't block the change. |
|
I think this means we're all good and this revert can be closed :-) |
|
Closing this out then. |
This reverts commit 281dd35.
This one wasn't quite baked yet.
#12816