pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

Why the Visual Studio Code recognizes `numpy.concatenate` as a variable?!

Open S3Y3D opened this issue 5 years ago • 2 comments

Both numpy.array and numpy.concatenate are functions in NumPy library, but the Visual Studio Code recognizes numpy.concatenate as a variable?!

9BLIU

  • Language Server version: Pylance v2021.5.4
  • OS and version: Windows 10 Pro, version 21H1
  • Python version: Anaconda inside WSL, Python 3.9.1

S3Y3D avatar Jun 02 '21 15:06 S3Y3D

If you right-click on concatenate and choose "Go To Declaration", you will see the reason for this. The numpy library ships with a type stub file (__init__.pyi) that provides a type annotation for this symbol, and it is annotated as a variable not a function.

The numpy maintainers are continuing to invest in improved type annotations, so I expect this will improve with upcoming releases of the library.

erictraut avatar Jun 02 '21 15:06 erictraut

If you right-click on concatenate and choose "Go To Declaration", you will see the reason for this. The numpy library ships with a type stub file (__init__.pyi) that provides a type annotation for this symbol, and it is annotated as a variable not a function.

The numpy maintainers are continuing to invest in improved type annotations, so I expect this will improve with upcoming releases of the library.

Thank you for your help

S3Y3D avatar Jun 02 '21 15:06 S3Y3D