Skip to content
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

Add support for generic slice type arguments in a slice expression #9533

Closed
erictraut opened this issue Dec 2, 2024 · 5 comments
Closed
Labels
addressed in next version Issue is fixed and will appear in next published version enhancement request New feature or request

Comments

@erictraut
Copy link
Collaborator

The typeshed definition for slice was recently updated to support generics. Pyright doesn't currently supply type arguments for the start, end, and step types when evaluating the type of a literal slice expression.

See this mypy issue for details.

@erictraut erictraut added the enhancement request New feature or request label Dec 2, 2024
erictraut added a commit that referenced this issue Dec 2, 2024
erictraut added a commit that referenced this issue Dec 2, 2024
@erictraut erictraut added the addressed in next version Issue is fixed and will appear in next published version label Dec 2, 2024
@erictraut
Copy link
Collaborator Author

@Dr-Irv, this will be included in pyright 1.1.390, which should be released tomorrow.

@Dr-Irv
Copy link

Dr-Irv commented Dec 2, 2024

@Dr-Irv, this will be included in pyright 1.1.390, which should be released tomorrow.

Thanks. For our CI purposes, we may have to pin down to 1.1.389, unless you have ideas on how we can support mypy 1.13.0 and pyright 1.1.390 at the same time when doing assert_type(). See my question here: python/mypy#18225 (comment)

@jorenham
Copy link

jorenham commented Dec 2, 2024

@Dr-Irv this should also work with the earlier pyright versions if you download the latest typeshed and use it with pyright --typeshedpath <DIRECTORY>

@jorenham
Copy link

jorenham commented Dec 2, 2024

oh nevermind, judging by b0cd5f1 this also required a change in pyright itself

@erictraut
Copy link
Collaborator Author

This is addressed in pyright 1.1.390.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed in next version Issue is fixed and will appear in next published version enhancement request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants