Comment 1 for bug 1675659

Revision history for this message
asmeurer (asmeurer) wrote :

The error seems correct to me. If you had

import bar

class Foo:
    a = bar

then Foo().a would be bar (the module). If you had

class Foo:
    def bar(self):
        pass

    a = bar

then Foo().a would be bar (the method). So the method does override the imported name in the class namespace, which pyflakes warns about (but only if the name is unused, to avoid false positives).