Skip to content

Replace plain slice type hints with IndexSlice. #13007

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

randolf-scholz
Copy link
Contributor

Trying to see what happens when we replace slice type hints with

IndexSlice: TypeAlias = slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]

annotations.

This comment has been minimized.

@brianschubert
Copy link
Member

This seems like a good improvement to me. I imagine this would be very nice for replacing mypy's hardcoded SupportsIndex/None checks for slice indices (python/mypy#2410).

It looks like the pytype errors may be due to pytype having its own builtins stubs, which don't define slice as being generic: https://github.com/google/pytype/blob/97d949161b27259af283fc1d271f8cf056ddf9b6/pytype/stubs/builtins/builtins.pytd#L972

This comment has been minimized.

@srittau
Copy link
Collaborator

srittau commented Feb 28, 2025

Closing in favor of #13008.

@srittau srittau closed this Feb 28, 2025
@randolf-scholz
Copy link
Contributor Author

randolf-scholz commented Feb 28, 2025

@srittau This PR is not in conflict with #13008, it is for making some annotations in the stubs more precise by replacing slice[Any, Any, Any] with more concrete types.

Thanks to #13008, one could now use slice[SupportsIndex | None] instead of an alias, since it will default to slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None].

@srittau srittau reopened this Feb 28, 2025

This comment has been minimized.

@srittau srittau mentioned this pull request Jul 16, 2025
@randolf-scholz
Copy link
Contributor Author

randolf-scholz commented Jul 30, 2025

This should probably not get merged as-is. For collections.abc.Sequence and collections.abc.MutableSequence we should probably consider whether to use the weaker slice[int | None] rather than slice[SupportsIndex | None], since that ABC also only requires int for non-slice __getitem__.

@randolf-scholz
Copy link
Contributor Author

Likewise, this would also affect operator.{getitem,setitem,delitem}

This comment has been minimized.

Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

colour (https://github.com/colour-science/colour)
- colour/models/tests/test_hunter_rdab.py:159: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_hunter_rdab.py:159: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_hunter_rdab.py:294: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_hunter_rdab.py:294: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_hunter_lab.py:233: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_hunter_lab.py:233: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_hunter_lab.py:368: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_hunter_lab.py:368: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_hdr_ipt.py:230: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_hdr_ipt.py:230: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_hdr_ipt.py:337: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_hdr_ipt.py:337: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_hdr_cie_lab.py:251: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_hdr_cie_lab.py:251: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_hdr_cie_lab.py:376: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_hdr_cie_lab.py:376: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_cie_uvw.py:133: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_cie_uvw.py:133: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_cie_uvw.py:243: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_cie_uvw.py:243: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_cie_luv.py:148: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_cie_luv.py:148: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_cie_luv.py:258: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_cie_luv.py:258: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_cie_luv.py:368: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_cie_luv.py:368: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_cie_luv.py:485: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_cie_luv.py:485: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_cie_luv.py:710: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_cie_luv.py:710: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_cie_luv.py:823: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_cie_luv.py:823: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_cie_lab.py:133: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_cie_lab.py:133: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/tests/test_cie_lab.py:243: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/tests/test_cie_lab.py:243: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/rgb/tests/test_rgb_colourspace.py:477: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/rgb/tests/test_rgb_colourspace.py:477: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/models/rgb/tests/test_rgb_colourspace.py:677: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/models/rgb/tests/test_rgb_colourspace.py:677: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/colorimetry/tests/test_whiteness.py:475: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/colorimetry/tests/test_whiteness.py:475: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/colorimetry/tests/test_whiteness.py:574: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/colorimetry/tests/test_whiteness.py:574: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_scam.py:215: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_scam.py:215: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_scam.py:404: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_scam.py:404: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_scam.py:406: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_scam.py:406: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_scam.py:407: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_scam.py:407: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_rlab.py:155: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_rlab.py:155: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_nayatani95.py:155: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_nayatani95.py:155: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_llab.py:223: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_llab.py:223: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_llab.py:224: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_llab.py:224: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_llab.py:225: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_llab.py:225: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_llab.py:434: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_llab.py:434: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_llab.py:435: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_llab.py:435: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_llab.py:438: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_llab.py:438: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_llab.py:441: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_llab.py:441: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_kim2009.py:223: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_kim2009.py:223: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_kim2009.py:224: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_kim2009.py:224: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_kim2009.py:225: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_kim2009.py:225: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_kim2009.py:434: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_kim2009.py:434: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_kim2009.py:435: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_kim2009.py:435: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_kim2009.py:438: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_kim2009.py:438: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_kim2009.py:441: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_kim2009.py:441: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_hunt.py:231: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_hunt.py:231: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_hunt.py:236: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_hunt.py:236: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_hunt.py:238: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_hunt.py:238: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_hellwig2022.py:242: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_hellwig2022.py:242: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_hellwig2022.py:243: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_hellwig2022.py:243: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_hellwig2022.py:449: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_hellwig2022.py:449: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_hellwig2022.py:452: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_hellwig2022.py:452: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_hellwig2022.py:455: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_hellwig2022.py:455: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_hellwig2022.py:456: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_hellwig2022.py:456: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_ciecam16.py:264: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_ciecam16.py:264: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_ciecam16.py:265: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_ciecam16.py:265: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_ciecam16.py:465: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_ciecam16.py:465: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_ciecam16.py:468: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_ciecam16.py:468: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_ciecam16.py:471: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_ciecam16.py:471: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_ciecam16.py:472: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_ciecam16.py:472: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_ciecam02.py:205: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_ciecam02.py:205: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_ciecam02.py:206: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_ciecam02.py:206: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_ciecam02.py:401: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_ciecam02.py:401: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_ciecam02.py:404: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_ciecam02.py:404: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_ciecam02.py:407: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_ciecam02.py:407: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_ciecam02.py:408: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_ciecam02.py:408: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_cam16.py:239: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_cam16.py:239: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_cam16.py:240: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_cam16.py:240: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_cam16.py:418: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_cam16.py:418: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_cam16.py:420: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_cam16.py:420: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_cam16.py:422: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_cam16.py:422: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_cam16.py:423: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_cam16.py:423: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/appearance/tests/test_atd95.py:201: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/appearance/tests/test_atd95.py:201: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/adaptation/tests/test_zhai2018.py:176: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/adaptation/tests/test_zhai2018.py:176: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/adaptation/tests/test_li2025.py:166: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/adaptation/tests/test_li2025.py:166: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/adaptation/tests/test_cmccat2000.py:160: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/adaptation/tests/test_cmccat2000.py:160: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/adaptation/tests/test_cmccat2000.py:295: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/adaptation/tests/test_cmccat2000.py:295: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/adaptation/tests/test_cie1994.py:158: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/adaptation/tests/test_cie1994.py:158: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/adaptation/tests/test_cie1994.py:159: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/adaptation/tests/test_cie1994.py:159: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/adaptation/tests/test_cie1994.py:160: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/adaptation/tests/test_cie1994.py:160: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/adaptation/tests/test_cie1994.py:161: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/adaptation/tests/test_cie1994.py:161: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]
- colour/adaptation/tests/test_cie1994.py:162: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[float]
+ colour/adaptation/tests/test_cie1994.py:162: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]

discord.py (https://github.com/Rapptz/discord.py)
- discord/http.py:235: note:     def __setitem__(self, slice[Any, Any, Any], Iterable[Embed], /) -> None
+ discord/http.py:235: note:     def __setitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], Iterable[Embed], /) -> None

freqtrade (https://github.com/freqtrade/freqtrade)
- freqtrade/rpc/telegram.py:395: note:     def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str
+ freqtrade/rpc/telegram.py:395: note:     def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str
- freqtrade/rpc/telegram.py:395: note:     def __getitem__(self, slice[Any, Any, Any], /) -> bytes
+ freqtrade/rpc/telegram.py:395: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> bytes
- freqtrade/rpc/telegram.py:396: note:     def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str
+ freqtrade/rpc/telegram.py:396: note:     def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str
- freqtrade/rpc/telegram.py:396: note:     def __getitem__(self, slice[Any, Any, Any], /) -> bytes
+ freqtrade/rpc/telegram.py:396: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> bytes
- freqtrade/templates/FreqaiExampleStrategy.py:287: note:     def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str
+ freqtrade/templates/FreqaiExampleStrategy.py:287: note:     def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str
- freqtrade/templates/FreqaiExampleStrategy.py:287: note:     def __getitem__(self, slice[Any, Any, Any], /) -> bytes
+ freqtrade/templates/FreqaiExampleStrategy.py:287: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> bytes
- freqtrade/templates/FreqaiExampleStrategy.py:290: note:     def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str
+ freqtrade/templates/FreqaiExampleStrategy.py:290: note:     def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str
- freqtrade/templates/FreqaiExampleStrategy.py:290: note:     def __getitem__(self, slice[Any, Any, Any], /) -> bytes
+ freqtrade/templates/FreqaiExampleStrategy.py:290: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> bytes

apprise (https://github.com/caronc/apprise)
- apprise/config/base.py:790: note:     def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str
+ apprise/config/base.py:790: note:     def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str
- apprise/config/base.py:818: note:     def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str
+ apprise/config/base.py:818: note:     def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str

operator (https://github.com/canonical/operator)
- ops/framework.py:1387: note:          def __getitem__(self, slice[Any, Any, Any], /) -> MutableSequence[Any]
+ ops/framework.py:1387: note:          def __getitem__(self, slice[int | None, int | None, int | None], /) -> MutableSequence[Any]
- ops/framework.py:1387: note:          def __getitem__(self, slice[Any, Any, Any], /) -> Sequence[Any]
+ ops/framework.py:1387: note:          def __getitem__(self, slice[int | None, int | None, int | None], /) -> Sequence[Any]
- ops/framework.py:1390: note:          def __setitem__(self, slice[Any, Any, Any], Iterable[Any], /) -> None
+ ops/framework.py:1390: note:          def __setitem__(self, slice[int | None, int | None, int | None], Iterable[Any], /) -> None
- ops/framework.py:1394: note:          def __delitem__(self, slice[Any, Any, Any], /) -> None
+ ops/framework.py:1394: note:          def __delitem__(self, slice[int | None, int | None, int | None], /) -> None

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/web_routedef.py:162:6: error: Signature of "__getitem__" incompatible with supertype "Sequence"  [override]
+ aiohttp/web_routedef.py:162:6: note:      Superclass:
+ aiohttp/web_routedef.py:162:6: note:          @overload
+ aiohttp/web_routedef.py:162:6: note:          def __getitem__(self, int, /) -> AbstractRouteDef
+ aiohttp/web_routedef.py:162:6: note:          @overload
+ aiohttp/web_routedef.py:162:6: note:          def __getitem__(self, slice[int | None, int | None, int | None], /) -> Sequence[AbstractRouteDef]
+ aiohttp/web_routedef.py:162:6: note:      Subclass:
+ aiohttp/web_routedef.py:162:6: note:          @overload
+ aiohttp/web_routedef.py:162:6: note:          def __getitem__(self, int, /) -> AbstractRouteDef
+ aiohttp/web_routedef.py:162:6: note:          @overload
+ aiohttp/web_routedef.py:162:6: note:          def __getitem__(self, slice[int, int, int], /) -> list[AbstractRouteDef]

dd-trace-py (https://github.com/DataDog/dd-trace-py)
- ddtrace/settings/_config.py:825: note:     def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str
+ ddtrace/settings/_config.py:825: note:     def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str

yarl (https://github.com/aio-libs/yarl)
- yarl/_url.py:1266:23: note:         def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str
+ yarl/_url.py:1266:23: note:         def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str
- yarl/_url.py:1266:23: note:         def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str
+ yarl/_url.py:1266:23: note:         def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str
- yarl/_url.py:1266:23: note:         def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str
+ yarl/_url.py:1266:23: note:         def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str
- yarl/_url.py:1266:23: note:         def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str
+ yarl/_url.py:1266:23: note:         def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/infrastructure/provisioners/container_instance.py:273: note:     def __getitem__(self, Union[SupportsIndex, slice[Any, Any, Any]], /) -> str
+ src/prefect/infrastructure/provisioners/container_instance.py:273: note:     def __getitem__(self, Union[SupportsIndex, slice[Optional[SupportsIndex], Optional[SupportsIndex], Optional[SupportsIndex]]], /) -> str
- src/prefect/infrastructure/provisioners/container_instance.py:274: note:     def __getitem__(self, Union[SupportsIndex, slice[Any, Any, Any]], /) -> str
+ src/prefect/infrastructure/provisioners/container_instance.py:274: note:     def __getitem__(self, Union[SupportsIndex, slice[Optional[SupportsIndex], Optional[SupportsIndex], Optional[SupportsIndex]]], /) -> str
- src/prefect/infrastructure/provisioners/container_instance.py:346: note:     def __getitem__(self, Union[SupportsIndex, slice[Any, Any, Any]], /) -> str
+ src/prefect/infrastructure/provisioners/container_instance.py:346: note:     def __getitem__(self, Union[SupportsIndex, slice[Optional[SupportsIndex], Optional[SupportsIndex], Optional[SupportsIndex]]], /) -> str
- src/prefect/infrastructure/provisioners/container_instance.py:355: note:     def __getitem__(self, Union[SupportsIndex, slice[Any, Any, Any]], /) -> str
+ src/prefect/infrastructure/provisioners/container_instance.py:355: note:     def __getitem__(self, Union[SupportsIndex, slice[Optional[SupportsIndex], Optional[SupportsIndex], Optional[SupportsIndex]]], /) -> str
- src/prefect/infrastructure/provisioners/container_instance.py:412: note:     def __getitem__(self, Union[SupportsIndex, slice[Any, Any, Any]], /) -> str
+ src/prefect/infrastructure/provisioners/container_instance.py:412: note:     def __getitem__(self, Union[SupportsIndex, slice[Optional[SupportsIndex], Optional[SupportsIndex], Optional[SupportsIndex]]], /) -> str
- src/prefect/infrastructure/provisioners/container_instance.py:637: note:     def __getitem__(self, Union[SupportsIndex, slice[Any, Any, Any]], /) -> str
+ src/prefect/infrastructure/provisioners/container_instance.py:637: note:     def __getitem__(self, Union[SupportsIndex, slice[Optional[SupportsIndex], Optional[SupportsIndex], Optional[SupportsIndex]]], /) -> str
- src/prefect/cli/deploy.py:1155: note:     def __setitem__(self, slice[Any, Any, Any], Iterable[dict[str, Any]], /) -> None
+ src/prefect/cli/deploy.py:1155: note:     def __setitem__(self, slice[Optional[SupportsIndex], Optional[SupportsIndex], Optional[SupportsIndex]], Iterable[dict[str, Any]], /) -> None
- src/prefect/cli/deploy.py:1181: note:     def __setitem__(self, slice[Any, Any, Any], Iterable[dict[str, Any]], /) -> None
+ src/prefect/cli/deploy.py:1181: note:     def __setitem__(self, slice[Optional[SupportsIndex], Optional[SupportsIndex], Optional[SupportsIndex]], Iterable[dict[str, Any]], /) -> None
- src/prefect/cli/deploy.py:1189: note:     def __setitem__(self, slice[Any, Any, Any], Iterable[dict[str, Any]], /) -> None
+ src/prefect/cli/deploy.py:1189: note:     def __setitem__(self, slice[Optional[SupportsIndex], Optional[SupportsIndex], Optional[SupportsIndex]], Iterable[dict[str, Any]], /) -> None
- src/prefect/cli/deploy.py:1206: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[dict[str, Any]]
+ src/prefect/cli/deploy.py:1206: note:     def __getitem__(self, slice[Optional[SupportsIndex], Optional[SupportsIndex], Optional[SupportsIndex]], /) -> list[dict[str, Any]]

manticore (https://github.com/trailofbits/manticore)
- tests/wasm/json2mc.py:103: note:     def __getitem__(self, slice[Any, Any, Any], /) -> list[Any]
+ tests/wasm/json2mc.py:103: note:     def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[Any]

@randolf-scholz randolf-scholz marked this pull request as ready for review July 30, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy