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

False positive E1120 no-value-for-parameter for class method #40

Closed
pylint-bot opened this issue Jul 24, 2013 · 3 comments
Closed

False positive E1120 no-value-for-parameter for class method #40

pylint-bot opened this issue Jul 24, 2013 · 3 comments
Labels
Bug 🪲 Checkers Related to a checker

Comments

@pylint-bot
Copy link

Originally reported by: BitBucket: mitar, GitHub: @mitar?


I have the following code:

#!python
class DisplayComponent(components.FrontendComponent):
    @classmethod
    def get_urls(cls):
        return super(DisplayComponent, cls).get_urls()

And pylint complains that "No value passed for parameter 'cls' in function call". Which is of course wrong as this is done automatically.

pylint 0.28.0,
astng 0.24.3, common 0.59.1


@pylint-bot
Copy link
Author

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):


mitar, is this still a problem? I cannot reproduce it with pylint 1.1, astroid 1.0.1, common 0.60.1.

@pylint-bot
Copy link
Author

Original comment by BitBucket: mitar, GitHub: @mitar?:


Oh. After more testing I discovered that I misattributed the problem. It seems I didn't read the lines correctly. The whole function is:

#!python
class DisplayComponent(components.FrontendComponent):
    @classmethod
    def get_urls(cls):
        return super(DisplayComponent, cls).get_urls() + urls.patterns(
            '',

            urls.url(r'^node/(?P<pk>[^/]+)/$', views.DisplayNode.as_view(), name='node'),
        )

And it fails at the views.DisplayNode.as_view() call. The reason for this is, it seems, because as_view is decorated with classonlymethod and not classmethod. See:

https://github.com/django/django/blob/master/django/utils/decorators.py#L8
https://github.com/django/django/blob/master/django/views/generic/base.py#L47

@pylint-bot
Copy link
Author

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):


Solved in astroid with https://bitbucket.org/logilab/astroid/commits/30cd4b487741674c7cfc0a75b09ed693955cbbc1.

@pylint-bot pylint-bot added Bug 🪲 Checkers Related to a checker labels Dec 9, 2015
msuozzo pushed a commit to msuozzo/pylint that referenced this issue Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 Checkers Related to a checker
Projects
None yet
Development

No branches or pull requests

1 participant