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

"Arguments missing" for optional arguments #43

Closed
onnoeberhard opened this issue Jul 3, 2020 · 8 comments
Closed

"Arguments missing" for optional arguments #43

onnoeberhard opened this issue Jul 3, 2020 · 8 comments
Assignees
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@onnoeberhard
Copy link

onnoeberhard commented Jul 3, 2020

I noticed that when I use a function with optional arguments I get an error message for "missing arguments". In this case, I was using the subplots function from the matplotlib.pyplot module. The actual error message was: Arguments missing for parameters "nrows", "ncols".

The function signature (https://matplotlib.org/_modules/matplotlib/pyplot.html#subplots) defines default arguments for these parameters. However, it looks like the pyplot.pyi file contains only def subplots(nrows: int, ncols: int, ....

Environment data

  • Language Server version: 2020.6.1
  • OS and version: Windows (10.0.17763 Build 17763)
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda Python 3.7.7

Expected behaviour

(no error)

Actual behaviour

(error)

@PrateekArya
Copy link

I got the same for using plt.hist() without "bins". Error message: Argument missing for parameter "bins"

@erictraut
Copy link
Contributor

It sounds like your type stub file (pyplot.pyi) contains a bug. Where did you get that stub? I don't see it included in the matplotlib package, nor do I see it in typeshed. In any case, the correct fix here is to fix the bug in the type stub file.

@onnoeberhard
Copy link
Author

The pyplot.pyi file is located here: ~/.vscode/extensions/ms-python.vscode-pylance-2020.6.1/server/bundled-stubs/matplotlib/pyplot.pyi. I don't know where it came from.

@PrateekArya
Copy link

I see the same issue with my type stub file.

image

image

Should I just modify this here?

@jakebailey jakebailey self-assigned this Jul 8, 2020
@jakebailey jakebailey added the bug Something isn't working label Jul 8, 2020
@jakebailey
Copy link
Member

You can modify this in the bundle if you wish, but I expect to fix this.

@jakebailey jakebailey added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Jul 8, 2020
@jakebailey
Copy link
Member

This issue has been fixed in version 2020.7.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202070-9-july-2020

@netanelbz123
Copy link

Same issue with ImageGrab.grab() from PIL
image

@jakebailey
Copy link
Member

Can you file a new issue? That's not related to this old closed issue, and is a bug with a bundled stub we ship.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

5 participants