Skip to content

Missing or incorrect completions for numpy 1.20.1 #1746

@cswartzvi

Description

@cswartzvi

I ran into a situation while using numpy 1.20.1 with vscode (jedi enabled), where some completions were either missing or had an incorrect type. I checked this with jedi.Script and it appears the problem is also present there as well. Here are some examples (using jedi 0.18.0):

  • numpy.linspace
>>> numpy.__version__
'1.19.5'
>>> print(jedi.Script("import numpy; numpy.lins").complete())
[<Completion: linspace>]
>>> numpy.__version__
'1.20.1'
>>> print(jedi.Script("import numpy; numpy.lins").complete())
[]
  • numpy.arange
>>> numpy.__version__
'1.19.5'
>>> print(jedi.Script("import numpy; numpy.arange").complete().pop().type)
function
>>> numpy.__version__
'1.20.1'
>>> print(jedi.Script("import numpy; numpy.arange").complete().pop().type)
statement

I am no expert on the internals of jedi or numpy, but could this related to the new type annotations introduced in numpy 1.20?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions