Closed einarwar closed 1 month ago
Thanks for the issue. This is because our bundled type stubs don't match your scikit-learn version. The stubs here need to be updated: https://github.com/microsoft/python-type-stubs/tree/main/stubs/sklearn
Thanks for the quick response. Should i raise an issue in that repo as well?
Yeah it wouldn't hurt. Somebody might have the time to update those stubs.
Took the matter into my own hands: https://github.com/microsoft/python-type-stubs/pull/317
One question though: Is this expected behaviour by pylance? I have read about the differences between pylance and pyright, e.g useLibraryCodeForTypes
. I tried with this setting both enabled and disabled, without any effect. I would have thought that the default behaviour regardless would be to inspect the package if it was installed. However, scikit-learn
does not have a py.typed
file, which might have an effect here
Took the matter into my own hands: microsoft/python-type-stubs#317
Thanks @einarwar! I just merged your PR. It will show up in next week's prerelease build.
useLibraryCodeForTypes
. I tried with this setting both enabled and disabled, without any effect.
useLibraryCodeForType
only comes into play when no stubs are found. You can read more about our resolution order here.
This issue has been fixed in prerelease version 2024.9.102, which we've just released. You can find the changelog here: CHANGELOG.md
Environment data
When checking the output from Python Language Server, there are two entries that might be related: