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

Cannot highlight a simple python code correctly! #888

Closed
sweettyler opened this issue Jan 28, 2021 · 2 comments
Closed

Cannot highlight a simple python code correctly! #888

sweettyler opened this issue Jan 28, 2021 · 2 comments
Labels
duplicate This issue or pull request already exists needs stub waiting for upstream Waiting for upstream to release a fix

Comments

@sweettyler
Copy link

source code:

import numpy as np

with np.load("A") as T:
x = T["c"]

print(f" x.shape: {x.shape}")

x = np.zeros((2, 2, 2))

print(f" x.shape: {x.shape}")

error_pylance

Environment data

  • Language Server version: v2021.1.3
  • OS and version: Linux x64 3.10.0-693.17.1.el7.x86_64
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.8.5 64-bit ('base': conda)

Expected behaviour

"shape" in both print are of same color

Actual behaviour

"shape" displayed in different colors (see snapshot)

Logs

XXX

Code Snippet / Additional information

XXX
@github-actions github-actions bot removed the triage label Jan 28, 2021
@judej judej added duplicate This issue or pull request already exists waiting for upstream Waiting for upstream to release a fix labels Jan 28, 2021
@judej
Copy link
Contributor

judej commented Jan 28, 2021

This is a dupe of #150.

@judej judej closed this as completed Jan 28, 2021
@jakebailey
Copy link
Member

Our scraped stub for np.zeros returns Any (as it's compiled and we don't guess), hence the color difference. Numpy's next version will have this return type fixed.

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 needs stub waiting for upstream Waiting for upstream to release a fix
Projects
None yet
Development

No branches or pull requests

3 participants