You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
l=list(range(10))
l[1:10:0] # ValueError: slice step cannot be zero
(sorry for raising so many issues, i'm working on a rule comparison table between all the type checkers and opening issues for each rule missing between ty/pyrefly/basedpyright. i think this is the last one for pyrefly!)
>>> l =list(range(10))
>>> l[1: 10: 0.5]
Traceback (most recent call last):
File "<python-input-2>", line 1, in <module>
l[1:10:1.5]
~^^^^^^^^^^
TypeError: slice indices must be integers or None or have an __index__ method
sorry for raising so many issues, i'm working on a rule comparison table between all the type checkers and opening issues for each rule missing between ty/pyrefly/basedpyright. i think this is the last one for pyrefly!
Thanks for that! We appreciate the thoroughness and these issues are really helpful
From what I see, Pyrefly doesn't report any issues when we have a decimal in the step variable, but we do check for the start index and end index. Sandbox link
This issue has someone assigned, but has not had recent activity for more than 2 weeks.
If you are still working on this issue, please add a comment so everyone knows. Otherwise, please unassign yourself and allow someone else to take over.
Activity
jorenham commentedon Jun 11, 2026
Pyrefly also does not report anything here:
https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIUABALxVQRwAuAFAE4YDmMLAjAAwBKQQB10UANq9EVATN6EArAF0QAXwA0IVAGMmEAG4wAYtBgU0WPETLqgA
yangdanny97 commentedon Jun 11, 2026
Thanks for that! We appreciate the thoroughness and these issues are really helpful
DetachHead commentedon Jun 13, 2026
here it is
ak4-sh commentedon Jun 13, 2026
@yangdanny97 Can I give this a go?
ak4-sh commentedon Jun 13, 2026
From what I see, Pyrefly doesn't report any issues when we have a decimal in the step variable, but we do check for the start index and end index. Sandbox link
jorenham commentedon Jun 13, 2026
FWIW; this doesn't seem to be a typeshed issue, which uses
slice[SupportsIndex | None]forlist.__getitem__:https://github.com/python/typeshed/blob/feeb9aa8dde3ae9269b13f3bae435b82d8538b76/stdlib/builtins.pyi#L1250-L1253
ak4-sh commentedon Jun 24, 2026
I'll give this a go then! #claim
github-actions commentedon Jun 24, 2026
@ak4-sh you've claimed this issue — it's now assigned to you. Thanks for picking it up! 🎉
github-actions commentedon Jul 11, 2026
This issue has someone assigned, but has not had recent activity for more than 2 weeks.
If you are still working on this issue, please add a comment so everyone knows. Otherwise, please unassign yourself and allow someone else to take over.
Thank you for your contributions!
Preserve omitted slice positions and validate builtin sequence slices (…
Preserve omitted slice positions and validate builtin sequence slices (…