Skip to content

slice constructors are broken when using None #13376

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

Closed
KotlinIsland opened this issue Jan 8, 2025 · 1 comment
Closed

slice constructors are broken when using None #13376

KotlinIsland opened this issue Jan 8, 2025 · 1 comment
Labels
stubs: false positive Type checkers report false errors

Comments

@KotlinIsland
Copy link
Contributor

a: slice[None, None, None] = slice(None, None, None)
Incompatible types in assignment (expression has type "slice[int | Any, int | Any, int | Any]", variable has type "slice[None, None, None]")

playground

@overload
def __new__(
cls, start: int | None, stop: int | None, step: int | None = None, /
) -> slice[int | MaybeNone, int | MaybeNone, int | MaybeNone]: ...

found here: data-apis/array-api-extra#82 (comment)

@brianschubert
Copy link
Contributor

I think this can be closed now that #13008 has been merged

@srittau srittau closed this as completed Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: false positive Type checkers report false errors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants