-
Notifications
You must be signed in to change notification settings - Fork 8
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
"Literal[5]" cannot be assigned to type "ToJustInt"
#420
Comments
"Literal[5]" cannot be assigned to type "ToJustInt"
What (pyright?) version are you using? |
I checked with the latest pyright, basedpyright, and mypy, but I can't reproduce it. import numpy as np
import scipy
coeffs = scipy.signal.firls(
numtaps=5,
bands=np.array([.0]),
desired=np.array([.0]),
weight=np.array([.0]),
fs=1.0,
) $ uv run pyright issue_420.py
0 errors, 0 warnings, 0 informations
$ uv run basedpyright issue_420.py
0 errors, 0 warnings, 0 notes
$ uv run mypy issue_420.py
Success: no issues found in 1 source file It would also help if you could share the particular config that you're using. |
I was seeing this in vscode with pylance extention 2024.12.100 which seems to use pyright 1.1.390 and the setting typeCheckingMode = "standard" But I tried command-line pyright 1.1.390 and 1.1.392 and that doesn't show any errors. Not sure how to explain this... |
Hmm that's indeed strange... As far as I'm aware, pylance directly uses pyright 🤔 |
Perhaps they use different typeshed versions? Because I recently fixed a bug there that was causing issues with these Anyway, you could try upgrading to the pre-release version of pylance, and see if that helps. |
I just tried with Pylance 2024.12.100 in |
├── scipy v1.15.1
├── scipy-stubs v1.15.1.0
This call
produces the following:
I don't understand why this doesn't type check?
The text was updated successfully, but these errors were encountered: