summaryrefslogtreecommitdiff
path: root/pylint
diff options
context:
space:
mode:
authorDani Alcala <112832187+clavedeluna@users.noreply.github.com>2022-10-20 11:35:53 -0300
committerGitHub <noreply@github.com>2022-10-20 16:35:53 +0200
commit15dd079792ce8e6b37856450f9e4a928f11b3549 (patch)
treeeb69d4759e3772d2402b46f365669e247b075f30 /pylint
parent5b7265bc705cabe27b8051753213dbf319e344a8 (diff)
downloadpylint-git-15dd079792ce8e6b37856450f9e4a928f11b3549.tar.gz
Remove __index__ from unnecessary-dunder-call check (#7650)
Diffstat (limited to 'pylint')
-rw-r--r--pylint/checkers/dunder_methods.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pylint/checkers/dunder_methods.py b/pylint/checkers/dunder_methods.py
index 1b61be7d4..2e5e54a57 100644
--- a/pylint/checkers/dunder_methods.py
+++ b/pylint/checkers/dunder_methods.py
@@ -100,7 +100,6 @@ DUNDER_METHODS: dict[tuple[int, int], dict[str, str]] = {
"__complex__": "Use complex built-in function",
"__int__": "Use int built-in function",
"__float__": "Use float built-in function",
- "__index__": "Use index method",
"__round__": "Use round built-in function",
"__trunc__": "Use math.trunc function",
"__floor__": "Use math.floor function",
@@ -125,7 +124,8 @@ class DunderCallChecker(BaseChecker):
We exclude __new__, __subclasses__, __init_subclass__, __set_name__,
__class_getitem__, __missing__, __exit__, __await__,
__aexit__, __getnewargs_ex__, __getnewargs__, __getstate__,
- __setstate__, __reduce__, __reduce_ex__
+ __setstate__, __reduce__, __reduce_ex__,
+ and __index__ (see https://github.com/PyCQA/pylint/issues/6795)
since these either have no alternative method of being called or
have a genuine use case for being called manually.