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 not-an-iterable for first argument staticmethod in metaclass #3032

Closed
ifinik opened this issue Jul 29, 2019 · 2 comments
Closed
Labels
Bug 🪲 Checkers Related to a checker

Comments

@ifinik
Copy link

ifinik commented Jul 29, 2019

Steps to reproduce

Save the following into a file and run pylint over it:

class My(type):
    @staticmethod
    def test(args):
        """
        Non-iterable value args is used in an iterating contextpylint(not-an-iterable)
        """
        #         \|/
        for i in args:
            print(i)

Current behavior

A not-an-iterable error is being emitted for correct code:
a.py:4:17: E1133: Non-iterable value args is used in an iterating context (not-an-iterable)

Expected behavior

No error should be emitted

pylint --version output

pylint 2.3.1
astroid 2.2.5

@PCManticore
Copy link
Contributor

Hey @ifinik Thanks for creating an issue. Please respect the template for new issues which indicates that it should have a reproduction example, the error you are seeing, the version of pylint you are using and so on. This time I went ahead and changed the issue for you.

@PCManticore PCManticore added Bug 🪲 Checkers Related to a checker labels Jul 29, 2019
@ifinik
Copy link
Author

ifinik commented Jul 29, 2019

@PCManticore , I apologize, thanks for the correction.
Is there somewhere an example of a template that can be referenced in such a case?

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

2 participants