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

Method overload stub gives "Method could be a function" #3439

Closed
opk12 opened this issue Mar 6, 2020 · 0 comments
Closed

Method overload stub gives "Method could be a function" #3439

opk12 opened this issue Mar 6, 2020 · 0 comments

Comments

@opk12
Copy link

opk12 commented Mar 6, 2020

from typing import overload


class Cls:
    @overload
    def method(self, param: int) -> None:
        ...

    @overload
    def method(self, param: str) -> None:
        ...

    def method(self, param):
        print(self.__repr__, param)
test1.py:6: [R0201(no-self-use), Cls.method] Method could be a function
test1.py:10: [R0201(no-self-use), Cls.method] Method could be a function

This is on the preview release 2.4.4 pip install pylint astroid --pre -U

A quick search for "overload" doesn't result in duplicate issues.

pylint --version output

(venv) $  pylint --version
pylint 2.4.4
astroid 2.3.3
Python 3.7.6 (default, Jan 30 2020, 09:44:41) 
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)]
@opk12 opk12 changed the title Method overload gives "Method could be a function" Method overload stub gives "Method could be a function" Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant