blob: a0ee991cbc21bad85dc12c5bc98541d39dea70c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# pylint: disable=too-few-public-methods,print-statement
"""check method hidding ancestor attribute
"""
from __future__ import print_function
class Abcd(object):
"""dummy"""
def __init__(self):
self.abcd = 1
class Cdef(Abcd):
"""dummy"""
def abcd(self): # [method-hidden]
"""test
"""
print(self)
class CustomProperty:
"""dummy"""
def __init__(self, _):
pass
def __get__(self, obj, __):
if not obj:
return self
return 5
def __set__(self, _, __):
pass
class Ddef:
"""dummy"""
def __init__(self):
self.five = "five"
@CustomProperty
def five(self):
"""Always 5."""
return self
|