-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Don't merge] Exploration of changing Sequence #12268
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mikeshardmind
force-pushed
the
sequence-mod-exploration
branch
from
July 3, 2024 11:29
aea5e83
to
3ea4fa3
Compare
This comment has been minimized.
This comment has been minimized.
…uence[str] soundness
mikeshardmind
force-pushed
the
sequence-mod-exploration
branch
from
July 3, 2024 11:37
3ea4fa3
to
af4c576
Compare
Diff from mypy_primer, showing the effect of this PR on open source code: dedupe (https://github.com/dedupeio/dedupe)
+ dedupe/clustering.py:146: error: Invalid index type "array[int]" for "ndarray[Any, dtype[Any]]"; expected type "slice | EllipsisType | SupportsIndex | _SupportsArray[dtype[numpy.bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool | integer[Any]]]] | builtins.bool | int | _NestedSequence[builtins.bool | int] | tuple[slice | EllipsisType | _SupportsArray[dtype[numpy.bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool | integer[Any]]]] | builtins.bool | int | _NestedSequence[builtins.bool | int] | SupportsIndex | None, ...] | None" [index]
+ dedupe/clustering.py:146: note: Following member(s) of "array[int]" have conflicts:
+ dedupe/clustering.py:146: note: Expected:
+ dedupe/clustering.py:146: note: def __contains__(self, object, /) -> bool
+ dedupe/clustering.py:146: note: Got:
+ dedupe/clustering.py:146: note: def __contains__(self, int, /) -> bool
+ dedupe/clustering.py:146: note: Expected:
+ dedupe/clustering.py:146: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[bool | integer[Any]]]]
+ dedupe/clustering.py:146: note: Got:
+ dedupe/clustering.py:146: note: @overload
+ dedupe/clustering.py:146: note: def __getitem__(self, SupportsIndex, /) -> int
+ dedupe/clustering.py:146: note: @overload
+ dedupe/clustering.py:146: note: def __getitem__(self, slice, /) -> array[int]
+ dedupe/clustering.py:146: note: <2 more conflict(s) not shown>
+ dedupe/clustering.py:146: note: Expected:
+ dedupe/clustering.py:146: note: def __contains__(self, object, /) -> bool
+ dedupe/clustering.py:146: note: Got:
+ dedupe/clustering.py:146: note: def __contains__(self, int, /) -> bool
+ dedupe/clustering.py:146: note: Expected:
+ dedupe/clustering.py:146: note: def __contains__(self, object, /) -> bool
+ dedupe/clustering.py:146: note: Got:
+ dedupe/clustering.py:146: note: def __contains__(self, int, /) -> bool
+ dedupe/clustering.py:146: note: Expected:
+ dedupe/clustering.py:146: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[bool | integer[Any]]]]
+ dedupe/clustering.py:146: note: Got:
+ dedupe/clustering.py:146: note: @overload
+ dedupe/clustering.py:146: note: def __getitem__(self, SupportsIndex, /) -> int
+ dedupe/clustering.py:146: note: @overload
+ dedupe/clustering.py:146: note: def __getitem__(self, slice, /) -> array[int]
+ dedupe/clustering.py:146: note: Expected:
+ dedupe/clustering.py:146: note: def __contains__(self, object, /) -> bool
+ dedupe/clustering.py:146: note: Got:
+ dedupe/clustering.py:146: note: def __contains__(self, int, /) -> bool
xarray (https://github.com/pydata/xarray)
+ xarray/namedarray/core.py: note: In member "reduce" of class "NamedArray":
+ xarray/namedarray/core.py:921: error: Argument 1 to "atleast_1d" has incompatible type "int | Sequence[int] | tuple[Any, ...]"; expected "_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]]" [arg-type]
+ xarray/tests/test_groupby.py: note: In member "test_groupby_properties" of class "TestDataArrayGroupBy":
+ xarray/tests/test_groupby.py:1268: error: Argument 1 to "assert_array_equal" has incompatible type "Sequence[int]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]" [arg-type]
+ xarray/tests/test_groupby.py: note: At top level:
trio (https://github.com/python-trio/trio)
+ src/trio/_core/_tests/test_instrumentation.py:38: error: Unsupported operand types for in ("Optional[Task]" and "Container[Task]") [operator]
mypy (https://github.com/python/mypy)
+ mypy/typeanal.py:1487: error: Unsupported operand types for in ("Optional[str]" and "Sequence[str]") [operator]
+ mypy/typeanal.py:1487: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-operator for more info
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/base.py:1537: error: Argument 1 to "repeat" of "ndarray" has incompatible type "int | Sequence[int]"; expected "_SupportsArray[dtype[numpy.bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool | integer[Any]]]] | builtins.bool | int | _NestedSequence[builtins.bool | int]" [arg-type]
+ pandas/io/formats/format.py:1593: error: Argument 1 to "ediff1d" has incompatible type "ndarray[Any, Any] | Sequence[float]"; expected "_SupportsArray[dtype[numpy.bool]] | _NestedSequence[_SupportsArray[dtype[numpy.bool]]] | builtins.bool | _NestedSequence[builtins.bool]" [arg-type]
+ pandas/plotting/_matplotlib/core.py:409: error: Need type annotation for "bad_labels" [var-annotated]
+ pandas/plotting/_matplotlib/core.py:409: error: Argument 2 to "extract" has incompatible type "Sequence[str]"; expected "_SupportsArray[dtype[Never]] | _NestedSequence[_SupportsArray[dtype[Never]]]" [arg-type]
+ pandas/plotting/_matplotlib/core.py:409: note: Following member(s) of "Sequence[str]" have conflicts:
+ pandas/plotting/_matplotlib/core.py:409: note: Expected:
+ pandas/plotting/_matplotlib/core.py:409: note: def __contains__(self, object, /) -> bool
+ pandas/plotting/_matplotlib/core.py:409: note: Got:
+ pandas/plotting/_matplotlib/core.py:409: note: def __contains__(self, str, /) -> bool
+ pandas/plotting/_matplotlib/core.py:409: note: Expected:
+ pandas/plotting/_matplotlib/core.py:409: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[Never]] | _NestedSequence[_SupportsArray[dtype[Never]]]
+ pandas/plotting/_matplotlib/core.py:409: note: Got:
+ pandas/plotting/_matplotlib/core.py:409: note: @overload
+ pandas/plotting/_matplotlib/core.py:409: note: def __getitem__(self, int, /) -> str
+ pandas/plotting/_matplotlib/core.py:409: note: @overload
+ pandas/plotting/_matplotlib/core.py:409: note: def __getitem__(self, slice, /) -> Sequence[str]
+ pandas/plotting/_matplotlib/core.py:409: note: <2 more conflict(s) not shown>
+ pandas/plotting/_matplotlib/boxplot.py:372: error: Need type annotation for "result" [var-annotated]
+ pandas/plotting/_matplotlib/boxplot.py:372: error: Argument 1 to "take" has incompatible type "list[str | Sequence[float]]"; expected "_SupportsArray[dtype[Never]] | _NestedSequence[_SupportsArray[dtype[Never]]]" [arg-type]
websockets (https://github.com/aaugustin/websockets)
+ src/websockets/legacy/server.py:125: error: Unsupported operand types for in ("str" and "Sequence[Origin | None]") [operator]
steam.py (https://github.com/Gobot1234/steam.py)
+ steam/trade.py:275: error: Unsupported operand types for in ("object" and "Sequence[ItemT]") [operator]
pylint (https://github.com/pycqa/pylint)
+ pylint/checkers/classes/class_checker.py:2189: error: Unsupported operand types for in ("str | None" and "Sequence[str]") [operator]
nox (https://github.com/wntrblm/nox)
+ nox/manifest.py:74: error: Unsupported operand types for in ("Union[str, SessionRunner]" and "Sequence[str]") [operator]
+ nox/manifest.py:171: error: Unsupported operand types for in ("Union[str, Sequence[str], bool, None]" and "Sequence[str]") [operator]
+ nox/manifest.py:322: error: Unsupported operand types for in ("Union[str, SessionRunner]" and "Sequence[str]") [operator]
mkdocs (https://github.com/mkdocs/mkdocs)
+ mkdocs/config/config_options.py:379: error: Unsupported operand types for in ("object" and "Collection[T]") [operator]
operator (https://github.com/canonical/operator)
- ops/model.py:831: error: Argument 1 of "__contains__" is incompatible with supertype "Container"; supertype defines the argument type as "object" [override]
- ops/model.py:876: error: Argument 1 of "__contains__" is incompatible with supertype "Container"; supertype defines the argument type as "object" [override]
- ops/model.py:1661: error: Argument 1 of "__contains__" is incompatible with supertype "Container"; supertype defines the argument type as "object" [override]
- ops/model.py:2062: error: Argument 1 of "__contains__" is incompatible with supertype "Container"; supertype defines the argument type as "object" [override]
jax (https://github.com/google/jax)
+ jax/_src/lax/convolution.py:144: error: Need type annotation for "rhs_shape" [var-annotated]
+ jax/_src/lax/convolution.py:144: error: Argument 1 to "take" has incompatible type "tuple[int, ...]"; expected "_SupportsArray[dtype[Never]] | _NestedSequence[_SupportsArray[dtype[Never]]]" [arg-type]
+ jax/_src/lax/convolution.py:144: error: Argument 2 to "take" has incompatible type "Sequence[int]"; expected "_SupportsArray[dtype[numpy.bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool | integer[Any]]]] | builtins.bool | int | _NestedSequence[builtins.bool | int]" [arg-type]
+ jax/_src/lax/convolution.py:144: note: Following member(s) of "Sequence[int]" have conflicts:
+ jax/_src/lax/convolution.py:144: note: Expected:
+ jax/_src/lax/convolution.py:144: note: def __contains__(self, object, /) -> bool
+ jax/_src/lax/convolution.py:144: note: Got:
+ jax/_src/lax/convolution.py:144: note: def __contains__(self, int, /) -> bool
+ jax/_src/lax/convolution.py:144: note: Expected:
+ jax/_src/lax/convolution.py:144: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[bool | integer[Any]]]]
+ jax/_src/lax/convolution.py:144: note: Got:
+ jax/_src/lax/convolution.py:144: note: @overload
+ jax/_src/lax/convolution.py:144: note: def __getitem__(self, int, /) -> int
+ jax/_src/lax/convolution.py:144: note: @overload
+ jax/_src/lax/convolution.py:144: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/_src/lax/convolution.py:144: note: <2 more conflict(s) not shown>
+ jax/_src/lax/convolution.py:144: note: Expected:
+ jax/_src/lax/convolution.py:144: note: def __contains__(self, object, /) -> bool
+ jax/_src/lax/convolution.py:144: note: Got:
+ jax/_src/lax/convolution.py:144: note: def __contains__(self, int, /) -> bool
+ jax/_src/lax/convolution.py:144: note: Expected:
+ jax/_src/lax/convolution.py:144: note: def __contains__(self, object, /) -> bool
+ jax/_src/lax/convolution.py:144: note: Got:
+ jax/_src/lax/convolution.py:144: note: def __contains__(self, int, /) -> bool
+ jax/_src/lax/convolution.py:144: note: Expected:
+ jax/_src/lax/convolution.py:144: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[bool | integer[Any]]]]
+ jax/_src/lax/convolution.py:144: note: Got:
+ jax/_src/lax/convolution.py:144: note: @overload
+ jax/_src/lax/convolution.py:144: note: def __getitem__(self, int, /) -> int
+ jax/_src/lax/convolution.py:144: note: @overload
+ jax/_src/lax/convolution.py:144: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/_src/lax/convolution.py:144: note: Expected:
+ jax/_src/lax/convolution.py:144: note: def __contains__(self, object, /) -> bool
+ jax/_src/lax/convolution.py:144: note: Got:
+ jax/_src/lax/convolution.py:144: note: def __contains__(self, int, /) -> bool
+ jax/_src/lax/convolution.py:147: error: Argument 1 to "take" has incompatible type "tuple[int, ...]"; expected "_SupportsArray[dtype[Never]] | _NestedSequence[_SupportsArray[dtype[Never]]]" [arg-type]
+ jax/_src/lax/convolution.py:147: error: Argument 2 to "take" has incompatible type "Sequence[int]"; expected "_SupportsArray[dtype[numpy.bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool | integer[Any]]]] | builtins.bool | int | _NestedSequence[builtins.bool | int]" [arg-type]
+ jax/_src/lax/convolution.py:147: note: Following member(s) of "Sequence[int]" have conflicts:
+ jax/_src/lax/convolution.py:147: note: Expected:
+ jax/_src/lax/convolution.py:147: note: def __contains__(self, object, /) -> bool
+ jax/_src/lax/convolution.py:147: note: Got:
+ jax/_src/lax/convolution.py:147: note: def __contains__(self, int, /) -> bool
+ jax/_src/lax/convolution.py:147: note: Expected:
+ jax/_src/lax/convolution.py:147: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[bool | integer[Any]]]]
+ jax/_src/lax/convolution.py:147: note: Got:
+ jax/_src/lax/convolution.py:147: note: @overload
+ jax/_src/lax/convolution.py:147: note: def __getitem__(self, int, /) -> int
+ jax/_src/lax/convolution.py:147: note: @overload
+ jax/_src/lax/convolution.py:147: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/_src/lax/convolution.py:147: note: <2 more conflict(s) not shown>
+ jax/_src/lax/convolution.py:147: note: Expected:
+ jax/_src/lax/convolution.py:147: note: def __contains__(self, object, /) -> bool
+ jax/_src/lax/convolution.py:147: note: Got:
+ jax/_src/lax/convolution.py:147: note: def __contains__(self, int, /) -> bool
+ jax/_src/lax/convolution.py:147: note: Expected:
+ jax/_src/lax/convolution.py:147: note: def __contains__(self, object, /) -> bool
+ jax/_src/lax/convolution.py:147: note: Got:
+ jax/_src/lax/convolution.py:147: note: def __contains__(self, int, /) -> bool
+ jax/_src/lax/convolution.py:147: note: Expected:
+ jax/_src/lax/convolution.py:147: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[bool | integer[Any]]]]
+ jax/_src/lax/convolution.py:147: note: Got:
+ jax/_src/lax/convolution.py:147: note: @overload
+ jax/_src/lax/convolution.py:147: note: def __getitem__(self, int, /) -> int
+ jax/_src/lax/convolution.py:147: note: @overload
+ jax/_src/lax/convolution.py:147: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/_src/lax/convolution.py:147: note: Expected:
+ jax/_src/lax/convolution.py:147: note: def __contains__(self, object, /) -> bool
+ jax/_src/lax/convolution.py:147: note: Got:
+ jax/_src/lax/convolution.py:147: note: def __contains__(self, int, /) -> bool
+ jax/_src/lax/convolution.py:330: error: Need type annotation for "k_shape" [var-annotated]
+ jax/_src/lax/convolution.py:330: error: Argument 1 to "take" has incompatible type "tuple[int, ...]"; expected "_SupportsArray[dtype[Never]] | _NestedSequence[_SupportsArray[dtype[Never]]]" [arg-type]
+ jax/_src/lax/convolution.py:330: error: Argument 2 to "take" has incompatible type "Sequence[int]"; expected "_SupportsArray[dtype[numpy.bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool | integer[Any]]]] | builtins.bool | int | _NestedSequence[builtins.bool | int]" [arg-type]
+ jax/_src/lax/convolution.py:330: note: Following member(s) of "Sequence[int]" have conflicts:
+ jax/_src/lax/convolution.py:330: note: Expected:
+ jax/_src/lax/convolution.py:330: note: def __contains__(self, object, /) -> bool
+ jax/_src/lax/convolution.py:330: note: Got:
+ jax/_src/lax/convolution.py:330: note: def __contains__(self, int, /) -> bool
+ jax/_src/lax/convolution.py:330: note: Expected:
+ jax/_src/lax/convolution.py:330: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[bool | integer[Any]]]]
+ jax/_src/lax/convolution.py:330: note: Got:
+ jax/_src/lax/convolution.py:330: note: @overload
+ jax/_src/lax/convolution.py:330: note: def __getitem__(self, int, /) -> int
+ jax/_src/lax/convolution.py:330: note: @overload
+ jax/_src/lax/convolution.py:330: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/_src/lax/convolution.py:330: note: <2 more conflict(s) not shown>
+ jax/_src/lax/convolution.py:330: note: Expected:
+ jax/_src/lax/convolution.py:330: note: def __contains__(self, object, /) -> bool
+ jax/_src/lax/convolution.py:330: note: Got:
+ jax/_src/lax/convolution.py:330: note: def __contains__(self, int, /) -> bool
+ jax/_src/lax/convolution.py:410: error: Argument 2 to "take" has incompatible type "Sequence[int]"; expected "_SupportsArray[dtype[numpy.bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool | integer[Any]]]] | builtins.bool | int | _NestedSequence[builtins.bool | int]" [arg-type]
+ jax/_src/lax/convolution.py:410: note: Following member(s) of "Sequence[int]" have conflicts:
+ jax/_src/lax/convolution.py:410: note: Expected:
+ jax/_src/lax/convolution.py:410: note: def __contains__(self, object, /) -> bool
+ jax/_src/lax/convolution.py:410: note: Got:
+ jax/_src/lax/convolution.py:410: note: def __contains__(self, int, /) -> bool
+ jax/_src/lax/convolution.py:410: note: Expected:
+ jax/_src/lax/convolution.py:410: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[bool | integer[Any]]]]
+ jax/_src/lax/convolution.py:410: note: Got:
+ jax/_src/lax/convolution.py:410: note: @overload
+ jax/_src/lax/convolution.py:410: note: def __getitem__(self, int, /) -> int
+ jax/_src/lax/convolution.py:410: note: @overload
+ jax/_src/lax/convolution.py:410: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/_src/lax/convolution.py:410: note: <2 more conflict(s) not shown>
+ jax/_src/lax/convolution.py:410: note: Expected:
+ jax/_src/lax/convolution.py:410: note: def __contains__(self, object, /) -> bool
+ jax/_src/lax/convolution.py:410: note: Got:
+ jax/_src/lax/convolution.py:410: note: def __contains__(self, int, /) -> bool
+ jax/_src/lax/convolution.py:411: error: Argument 2 to "take" has incompatible type "Sequence[int]"; expected "_SupportsArray[dtype[numpy.bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool | integer[Any]]]] | builtins.bool | int | _NestedSequence[builtins.bool | int]" [arg-type]
+ jax/_src/lax/convolution.py:411: note: Following member(s) of "Sequence[int]" have conflicts:
+ jax/_src/lax/convolution.py:411: note: Expected:
+ jax/_src/lax/convolution.py:411: note: def __contains__(self, object, /) -> bool
+ jax/_src/lax/convolution.py:411: note: Got:
+ jax/_src/lax/convolution.py:411: note: def __contains__(self, int, /) -> bool
+ jax/_src/lax/convolution.py:411: note: Expected:
+ jax/_src/lax/convolution.py:411: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[bool | integer[Any]]] | _NestedSequence[_SupportsArray[dtype[bool | integer[Any]]]]
+ jax/_src/lax/convolution.py:411: note: Got:
+ jax/_src/lax/convolution.py:411: note: @overload
+ jax/_src/lax/convolution.py:411: note: def __getitem__(self, int, /) -> int
+ jax/_src/lax/convolution.py:411: note: @overload
+ jax/_src/lax/convolution.py:411: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/_src/lax/convolution.py:411: note: <2 more conflict(s) not shown>
+ jax/_src/lax/convolution.py:411: note: Expected:
+ jax/_src/lax/convolution.py:411: note: def __contains__(self, object, /) -> bool
+ jax/_src/lax/convolution.py:411: note: Got:
+ jax/_src/lax/convolution.py:411: note: def __contains__(self, int, /) -> bool
+ jax/_src/lax/convolution.py:414: error: Argument 1 to "argsort" has incompatible type "Sequence[int]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]" [arg-type]
+ jax/_src/numpy/lax_numpy.py:6480: error: Argument 1 to "shape" has incompatible type "Sequence[int]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]" [arg-type]
+ jax/_src/numpy/lax_numpy.py:6486: error: Argument 1 to "broadcast_to" has incompatible type "Sequence[int]"; expected "_SupportsArray[dtype[Never]] | _NestedSequence[_SupportsArray[dtype[Never]]]" [arg-type]
+ jax/_src/numpy/lax_numpy.py:6486: note: Following member(s) of "Sequence[int]" have conflicts:
+ jax/_src/numpy/lax_numpy.py:6486: note: Expected:
+ jax/_src/numpy/lax_numpy.py:6486: note: def __contains__(self, object, /) -> bool
+ jax/_src/numpy/lax_numpy.py:6486: note: Got:
+ jax/_src/numpy/lax_numpy.py:6486: note: def __contains__(self, int, /) -> bool
+ jax/_src/numpy/lax_numpy.py:6486: note: Expected:
+ jax/_src/numpy/lax_numpy.py:6486: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[Never]] | _NestedSequence[_SupportsArray[dtype[Never]]]
+ jax/_src/numpy/lax_numpy.py:6486: note: Got:
+ jax/_src/numpy/lax_numpy.py:6486: note: @overload
+ jax/_src/numpy/lax_numpy.py:6486: note: def __getitem__(self, int, /) -> int
+ jax/_src/numpy/lax_numpy.py:6486: note: @overload
+ jax/_src/numpy/lax_numpy.py:6486: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/_src/numpy/lax_numpy.py:6486: note: <2 more conflict(s) not shown>
+ jax/_src/numpy/lax_numpy.py:6486: note: Expected:
+ jax/_src/numpy/lax_numpy.py:6486: note: def __contains__(self, object, /) -> bool
+ jax/_src/numpy/lax_numpy.py:6486: note: Got:
+ jax/_src/numpy/lax_numpy.py:6486: note: def __contains__(self, int, /) -> bool
+ jax/_src/numpy/lax_numpy.py:6486: note: Expected:
+ jax/_src/numpy/lax_numpy.py:6486: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[Never]] | _NestedSequence[_SupportsArray[dtype[Never]]]
+ jax/_src/numpy/lax_numpy.py:6486: note: Got:
+ jax/_src/numpy/lax_numpy.py:6486: note: @overload
+ jax/_src/numpy/lax_numpy.py:6486: note: def __getitem__(self, int, /) -> int
+ jax/_src/numpy/lax_numpy.py:6486: note: @overload
+ jax/_src/numpy/lax_numpy.py:6486: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/_src/numpy/lax_numpy.py:6496: error: Argument 1 to "broadcast_arrays" has incompatible type "Sequence[int]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]" [arg-type]
+ jax/_src/numpy/lax_numpy.py:6496: error: Argument 2 to "broadcast_arrays" has incompatible type "Sequence[int]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]" [arg-type]
+ jax/_src/random.py:673: error: Argument 3 to "insert" has incompatible type "Sequence[int]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]" [arg-type]
+ jax/experimental/mesh_utils.py:305: error: Argument 1 to "prod" has incompatible type "Sequence[int]"; expected "_SupportsArray[dtype[numpy.bool]] | _NestedSequence[_SupportsArray[dtype[numpy.bool]]] | builtins.bool | _NestedSequence[builtins.bool]" [arg-type]
+ jax/experimental/mesh_utils.py:305: note: Following member(s) of "Sequence[int]" have conflicts:
+ jax/experimental/mesh_utils.py:305: note: Expected:
+ jax/experimental/mesh_utils.py:305: note: def __contains__(self, object, /) -> bool
+ jax/experimental/mesh_utils.py:305: note: Got:
+ jax/experimental/mesh_utils.py:305: note: def __contains__(self, int, /) -> bool
+ jax/experimental/mesh_utils.py:305: note: Expected:
+ jax/experimental/mesh_utils.py:305: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[bool]] | _NestedSequence[_SupportsArray[dtype[bool]]]
+ jax/experimental/mesh_utils.py:305: note: Got:
+ jax/experimental/mesh_utils.py:305: note: @overload
+ jax/experimental/mesh_utils.py:305: note: def __getitem__(self, int, /) -> int
+ jax/experimental/mesh_utils.py:305: note: @overload
+ jax/experimental/mesh_utils.py:305: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/experimental/mesh_utils.py:305: note: <2 more conflict(s) not shown>
+ jax/experimental/mesh_utils.py:305: note: Expected:
+ jax/experimental/mesh_utils.py:305: note: def __contains__(self, object, /) -> bool
+ jax/experimental/mesh_utils.py:305: note: Got:
+ jax/experimental/mesh_utils.py:305: note: def __contains__(self, int, /) -> bool
+ jax/experimental/mesh_utils.py:305: note: Expected:
+ jax/experimental/mesh_utils.py:305: note: def __getitem__(self, int, /) -> bool | _NestedSequence[bool]
+ jax/experimental/mesh_utils.py:305: note: Got:
+ jax/experimental/mesh_utils.py:305: note: @overload
+ jax/experimental/mesh_utils.py:305: note: def __getitem__(self, int, /) -> int
+ jax/experimental/mesh_utils.py:305: note: @overload
+ jax/experimental/mesh_utils.py:305: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/experimental/mesh_utils.py:670: error: Argument 1 to "prod" has incompatible type "Sequence[int]"; expected "_SupportsArray[dtype[numpy.bool]] | _NestedSequence[_SupportsArray[dtype[numpy.bool]]] | builtins.bool | _NestedSequence[builtins.bool]" [arg-type]
+ jax/experimental/mesh_utils.py:670: note: Following member(s) of "Sequence[int]" have conflicts:
+ jax/experimental/mesh_utils.py:670: note: Expected:
+ jax/experimental/mesh_utils.py:670: note: def __contains__(self, object, /) -> bool
+ jax/experimental/mesh_utils.py:670: note: Got:
+ jax/experimental/mesh_utils.py:670: note: def __contains__(self, int, /) -> bool
+ jax/experimental/mesh_utils.py:670: note: Expected:
+ jax/experimental/mesh_utils.py:670: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[bool]] | _NestedSequence[_SupportsArray[dtype[bool]]]
+ jax/experimental/mesh_utils.py:670: note: Got:
+ jax/experimental/mesh_utils.py:670: note: @overload
+ jax/experimental/mesh_utils.py:670: note: def __getitem__(self, int, /) -> int
+ jax/experimental/mesh_utils.py:670: note: @overload
+ jax/experimental/mesh_utils.py:670: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/experimental/mesh_utils.py:670: note: <2 more conflict(s) not shown>
+ jax/experimental/mesh_utils.py:670: note: Expected:
+ jax/experimental/mesh_utils.py:670: note: def __contains__(self, object, /) -> bool
+ jax/experimental/mesh_utils.py:670: note: Got:
+ jax/experimental/mesh_utils.py:670: note: def __contains__(self, int, /) -> bool
+ jax/experimental/mesh_utils.py:670: note: Expected:
+ jax/experimental/mesh_utils.py:670: note: def __getitem__(self, int, /) -> bool | _NestedSequence[bool]
+ jax/experimental/mesh_utils.py:670: note: Got:
+ jax/experimental/mesh_utils.py:670: note: @overload
+ jax/experimental/mesh_utils.py:670: note: def __getitem__(self, int, /) -> int
+ jax/experimental/mesh_utils.py:670: note: @overload
+ jax/experimental/mesh_utils.py:670: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/experimental/mesh_utils.py:750: error: Argument 1 to "prod" has incompatible type "Sequence[int]"; expected "_SupportsArray[dtype[numpy.bool]] | _NestedSequence[_SupportsArray[dtype[numpy.bool]]] | builtins.bool | _NestedSequence[builtins.bool]" [arg-type]
+ jax/experimental/mesh_utils.py:750: note: Following member(s) of "Sequence[int]" have conflicts:
+ jax/experimental/mesh_utils.py:750: note: Expected:
+ jax/experimental/mesh_utils.py:750: note: def __contains__(self, object, /) -> bool
+ jax/experimental/mesh_utils.py:750: note: Got:
+ jax/experimental/mesh_utils.py:750: note: def __contains__(self, int, /) -> bool
+ jax/experimental/mesh_utils.py:750: note: Expected:
+ jax/experimental/mesh_utils.py:750: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[bool]] | _NestedSequence[_SupportsArray[dtype[bool]]]
+ jax/experimental/mesh_utils.py:750: note: Got:
+ jax/experimental/mesh_utils.py:750: note: @overload
+ jax/experimental/mesh_utils.py:750: note: def __getitem__(self, int, /) -> int
+ jax/experimental/mesh_utils.py:750: note: @overload
+ jax/experimental/mesh_utils.py:750: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/experimental/mesh_utils.py:750: note: <2 more conflict(s) not shown>
+ jax/experimental/mesh_utils.py:750: note: Expected:
+ jax/experimental/mesh_utils.py:750: note: def __contains__(self, object, /) -> bool
+ jax/experimental/mesh_utils.py:750: note: Got:
+ jax/experimental/mesh_utils.py:750: note: def __contains__(self, int, /) -> bool
+ jax/experimental/mesh_utils.py:750: note: Expected:
+ jax/experimental/mesh_utils.py:750: note: def __getitem__(self, int, /) -> bool | _NestedSequence[bool]
+ jax/experimental/mesh_utils.py:750: note: Got:
+ jax/experimental/mesh_utils.py:750: note: @overload
+ jax/experimental/mesh_utils.py:750: note: def __getitem__(self, int, /) -> int
+ jax/experimental/mesh_utils.py:750: note: @overload
+ jax/experimental/mesh_utils.py:750: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/experimental/sparse/bcoo.py:583: error: Argument 1 to "argsort" has incompatible type "Sequence[int]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]" [arg-type]
+ jax/experimental/sparse/bcoo.py:1854: error: Argument 1 to "cumprod" has incompatible type "Sequence[int]"; expected "_SupportsArray[dtype[numpy.bool]] | _NestedSequence[_SupportsArray[dtype[numpy.bool]]] | builtins.bool | _NestedSequence[builtins.bool]" [arg-type]
+ jax/experimental/sparse/bcoo.py:1854: note: Following member(s) of "Sequence[int]" have conflicts:
+ jax/experimental/sparse/bcoo.py:1854: note: Expected:
+ jax/experimental/sparse/bcoo.py:1854: note: def __contains__(self, object, /) -> bool
+ jax/experimental/sparse/bcoo.py:1854: note: Got:
+ jax/experimental/sparse/bcoo.py:1854: note: def __contains__(self, int, /) -> bool
+ jax/experimental/sparse/bcoo.py:1854: note: Expected:
+ jax/experimental/sparse/bcoo.py:1854: note: def __getitem__(self, int, /) -> _SupportsArray[dtype[bool]] | _NestedSequence[_SupportsArray[dtype[bool]]]
+ jax/experimental/sparse/bcoo.py:1854: note: Got:
+ jax/experimental/sparse/bcoo.py:1854: note: @overload
+ jax/experimental/sparse/bcoo.py:1854: note: def __getitem__(self, int, /) -> int
+ jax/experimental/sparse/bcoo.py:1854: note: @overload
+ jax/experimental/sparse/bcoo.py:1854: note: def __getitem__(self, slice, /) -> Sequence[int]
+ jax/experimental/sparse/bcoo.py:1854: note: <2 more conflict(s) not shown>
+ jax/experimental/sparse/bcoo.py:1854: note: Expected:
+ jax/experimental/sparse/bcoo.py:1854: note: def __contains__(self, object, /) -> bool
+ jax/experimental/sparse/bcoo.py:1854: note: Got:
+ jax/experimental/sparse/bcoo.py:1854: note: def __contains__(self, int, /) -> bool
+ jax/experimental/sparse/bcoo.py:1854: note: Expected:
+ jax/experimental/sparse/bcoo.py:1854: note: def __getitem__(self, int, /) -> bool | _NestedSequence[bool]
+ jax/experimental/sparse/bcoo.py:1854: note: Got:
+ jax/experimental/sparse/bcoo.py:1854: note: @overload
+ jax/experimental/sparse/bcoo.py:1854: note: def __getitem__(self, int, /) -> int
+ jax/experimental/sparse/bcoo.py:1854: note: @overload
+ jax/experimental/sparse/bcoo.py:1854: note: def __getitem__(self, slice, /) -> Sequence[int]
porcupine (https://github.com/Akuli/porcupine)
+ porcupine/plugins/directory_tree.py:184: error: Unsupported operand types for in ("Path | None" and "Sequence[Path]") [operator]
+ porcupine/plugins/directory_tree.py:351: error: Unsupported operand types for in ("Path | None" and "Sequence[Path]") [operator]
optuna (https://github.com/optuna/optuna)
+ optuna/samplers/_base.py:243: error: Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has incompatible type "Sequence[float]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]" [arg-type]
+ optuna/samplers/_brute_force.py:204: error: Argument 1 to "choice" of "RandomState" has incompatible type "Sequence[float]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]" [arg-type]
+ tests/samplers_tests/test_nsgaiii.py:559: error: Argument 2 to "assert_almost_equal" has incompatible type "Sequence[float]"; expected "_SupportsArray[dtype[numpy.bool | number[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool | number[Any]]]] | builtins.bool | int | float | complex | _NestedSequence[builtins.bool | int | float | complex] | _SupportsArray[dtype[object_]] | _NestedSequence[_SupportsArray[dtype[object_]]]" [arg-type]
ibis (https://github.com/ibis-project/ibis)
- ibis/expr/datatypes/core.py:512: error: Argument 1 of "__contains__" is incompatible with supertype "Sequence"; supertype defines the argument type as "object" [override]
- ibis/expr/datatypes/core.py:512: error: Argument 1 of "__contains__" is incompatible with supertype "Container"; supertype defines the argument type as "object" [override]
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This relates to https://discuss.python.org/t/removing-sequence-str-as-base-class-of-str/56907/25#changing-the-typeshed-for-sequence-2 and general explorations to improving soundness around Sequence[str], this is not something which would alone fix all issues and is part of a discussion about multiple changes which might be beneficial to be taken together.