[Python-projects] W0212 False Positive

Chris Mellon arkanes at gmail.com
Tue Dec 19 19:48:02 CET 2006


The checker for W0212(access to a protected member of a client class)
, implemented in vist_getattr in classes.py, allows calls to your base
class, but not your own class.

Example:

class Foo:
    _attr = 1
    def foo(self):
        Foo._attr += 1 #False positive - raises W0212

class Bar(Foo):
    def bar(self):
        Foo._attr += 1 #No error


More information about the Python-Projects mailing list