-
Notifications
You must be signed in to change notification settings - Fork 233
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
PyCharm warnings about unfilled parameters #134
Comments
That is odd. Any idea what mechanism PyCharm uses to introspect the method details? The |
@GrahamDumpleton This is the output (formatted by me):
I honestly don't know how PyCharm performs introspection :/ |
What exact version of Python is this, and what distribution if not the original CPython from the PSF? When
|
@GrahamDumpleton My apologies, I thought you meant
This is the full Python version information:
(If it matters, I built and installed this Python version using pyenv.) This is the detailed PyCharm information: PyCharm 2019.1.2 (Professional Edition) |
Yes, but PyCharm is possibly looking at what you did. The highlighting is actually on the decorator and not the wrapped function, and |
Would you possibly be able to install the
I have made a change which means the decorator created should return as signature that of the original decorator function, and not the wrapper.
This should hopefully satisfy what the linters are looking for. Note that the |
Unfortunately, using the develop.zip archive, PyCharm still complains with the same warning: With this code: import wrapt
@wrapt.decorator
def wrapper(wrapped, _instance, args, kwargs):
return wrapped(*args, **kwargs)
@wrapper
def foo():
pass ... FullArgSpec(args=['wrapper', 'enabled', 'adapter'], varargs=None, varkw=None, defaults=(None, None, None), kwonlyargs=[], kwonlydefaults=None, annotations={}) ...and FullArgSpec(args=[], varargs=None, varkw=None, defaults=None, kwonlyargs=[], kwonlydefaults=None, annotations={}) So I'm not sure what is really going on here? It's the same behavior in Python 3.5.6 and 3.7.3. I've tried searching for an explanation of how PyCharm introspects these things, to no avail :( |
I believe I'm seeing a similar issue with https://github.com/microsoft/pyright/. import wrapt
@wrapt.decorator
def foo(wrapper, instance, args, kwargs):
return wrapper(*args, **kwargs)
@foo <---- error Arguments missing for parameters "instance", "args", "kwargs"
def bar(x: int) -> int:
return x Here are a couple of related discussions: microsoft/pyright#413, microsoft/pyright#774, which seem to suggest that |
Experiencing the same as well with Pylance with the general example
|
This library amazing, thank you for making it.
However, one minor issue when I use it in PyCharm (and probably other linters)...
I've written this simple decorator:
Then I use it like this:
The warning looks like this:
Is there any way to get around this warning without prefixing the method with
# noinspection PyArgumentList
?The text was updated successfully, but these errors were encountered: