Skip to content

Commit fd18848

Browse files
authored
Add regression test for issue #5382 (#5550)
1 parent 889a1d0 commit fd18848

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""Test to see we don't crash on this code in pandas.
2+
See: https://github.com/pandas-dev/pandas/blob/master/pandas/core/indexes/period.py
3+
Reported in https://github.com/PyCQA/pylint/issues/5382
4+
"""
5+
# pylint: disable=missing-function-docstring, missing-class-docstring, no-self-use, unused-argument
6+
# pylint: disable=too-few-public-methods, no-method-argument, invalid-name
7+
8+
9+
def my_decorator(*params):
10+
def decorator(decorated):
11+
return decorated
12+
13+
return decorator
14+
15+
16+
class ClassWithProperty:
17+
def f():
18+
return "string"
19+
20+
f.__name__ = "name"
21+
f.__doc__ = "docstring"
22+
23+
hour = property(f)
24+
25+
26+
class ClassWithDecorator:
27+
@my_decorator(ClassWithProperty.hour.fget)
28+
def my_property(self) -> str:
29+
return "a string"

0 commit comments

Comments
 (0)