Using flake8 as my linter, if I write some Python code that references a non-existent function in the same file, VS Code flags it up as an undefined variable. However, if I try to reference a non-existent function in a class, it doesn't. For example:
class Foo:
    def bar(self):
        return
one = Foo()
one.bar()  # No warning
one.foo()  # No warning either!
doesn't generate any warnings against the one.foo() line.
Is there a setting I need to change in the VS Code Python extension to get this to work or is it a limitation of the system?
Edited to make it clear that I was using flake8. All of the suggested solutions mention pylint which does work. I'm still interested in whether or not this can work with flake8 but pylint is working for me as an alternative.
Just set pylint and yo will have it.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With