third_party.pylibs.pylint.src/test/input/func_class_access_protected_members.py
Sylvain Thénault 53f596746d * new W0212 message for access to protected member from client code
* new W0212 message for access to protected member from client code
    * new W0105 message extracted from W0104 (statement seems to have no effect)
      with string
2006-05-05 14:20:44 +00:00

31 lines
626 B
Python

# pylint: disable-msg=R0903
"""test external access to protected class members"""
__revision__ = ''
class MyClass:
"""class docstring"""
_cls_protected = 5
def __init__(self, other):
"""init"""
self._protected = 1
self.public = other
def test(self):
"""test"""
self._protected += self._cls_protected
print self.public._haha
def clsmeth(cls):
"""this is ok"""
print cls._cls_protected
clsmeth = classmethod(clsmeth)
INST = MyClass()
print INST.public
print INST._protected
print INST._cls_protected