diff options
-rw-r--r-- | pylint/test/functional/member_checks.py | 6 | ||||
-rw-r--r-- | pylint/test/functional/member_checks.txt | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/pylint/test/functional/member_checks.py b/pylint/test/functional/member_checks.py index 8838fae..50a0d97 100644 --- a/pylint/test/functional/member_checks.py +++ b/pylint/test/functional/member_checks.py @@ -173,3 +173,9 @@ def no_conjugate_member(magic_flag): if isinstance(something, float): return something return something.conjugate() + + +class NoDunderNameInInstance(object): + """Emit a warning when accessing __name__ from an instance.""" + def __init__(self): + self.var = self.__name__ # [no-member] diff --git a/pylint/test/functional/member_checks.txt b/pylint/test/functional/member_checks.txt index 3d50a25..6e527bc 100644 --- a/pylint/test/functional/member_checks.txt +++ b/pylint/test/functional/member_checks.txt @@ -15,3 +15,4 @@ no-member:120::Class 'Client' has no 'missing' member:INFERENCE no-member:144::Class 'Client' has no 'ala' member:INFERENCE no-member:145::Class 'dict' has no 'bala' member:INFERENCE no-member:146::Class 'str' has no 'portocala' member:INFERENCE +no-member:181:NoDunderNameInInstance.__init__:Instance of 'NoDunderNameInInstance' has no '__name__' member:INFERENCE
\ No newline at end of file |