Replies: 1 comment 4 replies
-
I suspect this is because of "useLibraryCodeForTypes": true as default and amount of magical import weirdness tensorflow does. My guess is if you disable "useLibraryCodeForTypes": false it'll fail to complete/no errors. "useLibraryCodeForTypes": true is helpful for IDE features, but is less reliable for type checking especially for libraries with a lot of dynamic magic. Tensorflow uses heavy amount of dynamic import magic so I've found "useLibraryCodeForTypes": true to be prone to false positives with it. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I know that tensorflow doesnt have terribly good type annotations yet. However, I seem to have some jumpy behavior with the LSP and it doesnt always seem to be the same as when I run it in "batch mode" using
pyright some_file.py
:Generally, when in LSP mode, this doesnt work:
Yet, when I do:
On top of that, the first version is shown as an error in LSP mode, but when I run it using
pyright some_file.py
I get no errors.It's not completely clear that my LSP mode and "batch mode" are running in the exact same settings, but they do use the same
pyproject.toml
.But as for the difference in LSP mode: Does the LSP mode have some kind of timeout how deep it scans into a library to inspect things? Is that maybe why it gets it only in the second case?
cheers, Daniel.
Beta Was this translation helpful? Give feedback.
All reactions