We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
bad-dunder-name
__index__
1 parent 389e14c commit e507a4dCopy full SHA for e507a4d
3 files changed
doc/whatsnew/fragments/8613.false_positive
@@ -0,0 +1,3 @@
1
+Fix a false positive for ``bad-dunder-name`` when there is a user-defined ``__index__`` method.
2
+
3
+Closes #8613
pylint/constants.py
@@ -281,6 +281,7 @@ def _get_pylint_home() -> str:
281
"__getnewargs_ex__",
282
"__getnewargs__",
283
"__getstate__",
284
+ "__index__",
285
"__setstate__",
286
"__reduce__",
287
"__reduce_ex__",
tests/functional/ext/bad_dunder/bad_dunder_name.py
@@ -49,6 +49,9 @@ def __private_method(self):
49
def __doc__(self):
50
return "Docstring"
51
52
+ def __index__(self):
53
+ return 1
54
55
56
def __increase_me__(val):
57
return val + 1
0 commit comments