mirror of
https://fuchsia.googlesource.com/third_party/github.com/pylint-dev/pylint
synced 2024-09-21 16:19:21 +00:00
53f596746d
* 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
31 lines
626 B
Python
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
|
|
|