Uh oh!
There was an error while loading. Please reload this page.
Replace plain slice type hints with IndexSlice. - #13007
Conversation
This comment has been minimized.
This comment has been minimized.
brianschubert
commented
Nov 18, 2024
This seems like a good improvement to me. I imagine this would be very nice for replacing mypy's hardcoded It looks like the pytype errors may be due to pytype having its own builtins stubs, which don't define |
This comment has been minimized.
This comment has been minimized.
srittau
commented
Feb 28, 2025
Closing in favor of #13008. |
@srittau This PR is not in conflict with #13008, it is for making some annotations in the stubs more precise by replacing Thanks to #13008, one could now use |
c546ac4 to
90154feCompare
This comment has been minimized.
This comment has been minimized.
This should probably not get merged as-is. For |
randolf-scholz
commented
Jul 30, 2025
Likewise, this would also affect |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Use `slice[SupportesIndex | None]` in more places that support it Use more precise `slice[SupportesIndex | None]` rather than `slice` in many places
0e8ee4c to
c62b54bCompareDiff from mypy_primer, showing the effect of this PR on open source code: 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[Optional[SupportsIndex], Optional[SupportsIndex], Optional[SupportsIndex]], /) -> list[Any]
freqtrade (https://github.com/freqtrade/freqtrade)
- freqtrade/rpc/telegram.py:408: note: def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str+ freqtrade/rpc/telegram.py:408: note: def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str- freqtrade/rpc/telegram.py:408: note: def __getitem__(self, slice[Any, Any, Any], /) -> bytes+ freqtrade/rpc/telegram.py:408: note: def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> bytes- freqtrade/rpc/telegram.py:409: note: def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str+ freqtrade/rpc/telegram.py:409: note: def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str- freqtrade/rpc/telegram.py:409: note: def __getitem__(self, slice[Any, Any, Any], /) -> bytes+ freqtrade/rpc/telegram.py:409: 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
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:162: note: def __getitem__(self, slice[Any, Any, Any], /) -> list[float]+ colour/adaptation/tests/test_cmccat2000.py:162: note: def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[float]- colour/adaptation/tests/test_cmccat2000.py:297: note: def __getitem__(self, slice[Any, Any, Any], /) -> list[float]+ colour/adaptation/tests/test_cmccat2000.py:297: 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]
apprise (https://github.com/caronc/apprise)
- apprise/config/base.py:795: note: def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str+ apprise/config/base.py:795: note: def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str- apprise/config/base.py:823: note: def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str+ apprise/config/base.py:823: 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:274: note: def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str+ src/prefect/infrastructure/provisioners/container_instance.py:274: note: def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str- src/prefect/infrastructure/provisioners/container_instance.py:275: note: def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str+ src/prefect/infrastructure/provisioners/container_instance.py:275: note: def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str- src/prefect/infrastructure/provisioners/container_instance.py:347: note: def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str+ src/prefect/infrastructure/provisioners/container_instance.py:347: note: def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str- src/prefect/infrastructure/provisioners/container_instance.py:356: note: def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str+ src/prefect/infrastructure/provisioners/container_instance.py:356: note: def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str- src/prefect/infrastructure/provisioners/container_instance.py:413: note: def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str+ src/prefect/infrastructure/provisioners/container_instance.py:413: note: def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str- src/prefect/infrastructure/provisioners/container_instance.py:638: note: def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str+ src/prefect/infrastructure/provisioners/container_instance.py:638: note: def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str- src/prefect/cli/deploy/_actions.py:165: note: def __setitem__(self, slice[Any, Any, Any], Iterable[dict[str, Any]], /) -> None+ src/prefect/cli/deploy/_actions.py:165: note: def __setitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], Iterable[dict[str, Any]], /) -> None- src/prefect/cli/deploy/_actions.py:193: note: def __setitem__(self, slice[Any, Any, Any], Iterable[dict[str, Any]], /) -> None+ src/prefect/cli/deploy/_actions.py:193: note: def __setitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], Iterable[dict[str, Any]], /) -> None- src/prefect/cli/deploy/_actions.py:201: note: def __setitem__(self, slice[Any, Any, Any], Iterable[dict[str, Any]], /) -> None+ src/prefect/cli/deploy/_actions.py:201: note: def __setitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], Iterable[dict[str, Any]], /) -> None- src/prefect/cli/deploy/_actions.py:220: note: def __getitem__(self, slice[Any, Any, Any], /) -> list[dict[str, Any]]+ src/prefect/cli/deploy/_actions.py:220: note: def __getitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[dict[str, Any]]
scipy (https://github.com/scipy/scipy)
- scipy/spatial/transform/_rotation_xp.py:539: note: def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str+ scipy/spatial/transform/_rotation_xp.py:539: note: def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str- scipy/spatial/transform/_rigid_transform_xp.py:300: note: def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str+ scipy/spatial/transform/_rigid_transform_xp.py:300: note: def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str- scipy/spatial/transform/_rigid_transform_xp.py:301: note: def __getitem__(self, SupportsIndex | slice[Any, Any, Any], /) -> str+ scipy/spatial/transform/_rigid_transform_xp.py:301: note: def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str
discord.py (https://github.com/Rapptz/discord.py)
- discord/http.py:242: note: def __setitem__(self, slice[Any, Any, Any], Iterable[Embed], /) -> None+ discord/http.py:242: note: def __setitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], Iterable[Embed], /) -> None
operator (https://github.com/canonical/operator)
- ops/framework.py:1385: note: def __getitem__(self, slice[Any, Any, Any], /) -> MutableSequence[Any]+ ops/framework.py:1385: note: def __getitem__(self, slice[int | None, int | None, int | None], /) -> MutableSequence[Any]- ops/framework.py:1385: note: def __getitem__(self, slice[Any, Any, Any], /) -> Sequence[Any]+ ops/framework.py:1385: note: def __getitem__(self, slice[int | None, int | None, int | None], /) -> Sequence[Any]- ops/framework.py:1388: note: def __setitem__(self, slice[Any, Any, Any], Iterable[Any], /) -> None+ ops/framework.py:1388: note: def __setitem__(self, slice[int | None, int | None, int | None], Iterable[Any], /) -> None- ops/framework.py:1392: note: def __delitem__(self, slice[Any, Any, Any], /) -> None+ ops/framework.py:1392: note: def __delitem__(self, slice[int | None, int | None, int | None], /) -> None
aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/web_routedef.py:151:6: error: Signature of "__getitem__" incompatible with supertype "typing.Sequence" [override]+ aiohttp/web_routedef.py:151:6: note: Superclass:+ aiohttp/web_routedef.py:151:6: note: @overload+ aiohttp/web_routedef.py:151:6: note: def __getitem__(self, int, /) -> AbstractRouteDef+ aiohttp/web_routedef.py:151:6: note: @overload+ aiohttp/web_routedef.py:151:6: note: def __getitem__(self, slice[int | None, int | None, int | None], /) -> Sequence[AbstractRouteDef]+ aiohttp/web_routedef.py:151:6: note: Subclass:+ aiohttp/web_routedef.py:151:6: note: @overload+ aiohttp/web_routedef.py:151:6: note: def __getitem__(self, int, /) -> AbstractRouteDef+ aiohttp/web_routedef.py:151:6: note: @overload+ aiohttp/web_routedef.py:151:6: note: def __getitem__(self, slice[int, int, int], /) -> list[AbstractRouteDef] |
randolf-scholz
commented
Jan 22, 2026
Hm, the only thing that sticks out to me is the |
srittau
left a comment
There was a problem hiding this comment.
It looks as if aiohttp just needs to update its type hints, as the slice is just passed on to a list instance. int | None seems fine for the ABCs. (SupportsIndex | None would have been too loose.)
Trying to see what happens when we replace
slicetype hints withannotations.