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

np.equal is not a known member of module Pylance #504

Closed
fnl opened this issue Oct 19, 2020 · 3 comments
Closed

np.equal is not a known member of module Pylance #504

fnl opened this issue Oct 19, 2020 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@fnl
Copy link

fnl commented Oct 19, 2020

Environment data

  • Language Server version: 2020.10.1
  • OS and version: OSX 10.15.7
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7

Expected behaviour

no error highlight when typing:

import numpy as np
np.equal(1, np.ones(2))

Actual behaviour

an error is indicated:

"message": "\"equal\" is not a known member of module",
"source": "Pylance (reportGeneralTypeIssues)",

Logs

N/A

Code Snippet / Additional information

import numpy as np
np.equal(1, np.ones(2))
@jakebailey
Copy link
Member

Duplicate of #150; this should be improved once numpy releases with type stubs.

Numpy has some dynamic behaviors that prevent us from knowing if certain values exist, or should be re-exported from modules. Their new stub is much more clear.

@jakebailey jakebailey added the duplicate This issue or pull request already exists label Oct 19, 2020
@github-actions github-actions bot removed the triage label Oct 19, 2020
@fnl
Copy link
Author

fnl commented Oct 20, 2020

Thanks for the explanations; Am I correct in deducing that Pylance and Numpy will only play well together with future versions of Numpy, whenever they support type stubs?

@jakebailey
Copy link
Member

Some things work, but others don't. At some point we may add back compiled code scraping, but that is difficult to do correctly and doesn't fit nicely into the type system/analysis without some more thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants