summaryrefslogtreecommitdiff
path: root/pylint/checkers/classes/class_checker.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/checkers/classes/class_checker.py')
-rw-r--r--pylint/checkers/classes/class_checker.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/pylint/checkers/classes/class_checker.py b/pylint/checkers/classes/class_checker.py
index 77a795bcb..bdfb0968a 100644
--- a/pylint/checkers/classes/class_checker.py
+++ b/pylint/checkers/classes/class_checker.py
@@ -6,13 +6,12 @@
from __future__ import annotations
-import collections
from collections import defaultdict
from collections.abc import Callable, Sequence
from functools import cached_property
from itertools import chain, zip_longest
from re import Pattern
-from typing import TYPE_CHECKING, Any, Union
+from typing import TYPE_CHECKING, Any, NamedTuple, Union
import astroid
from astroid import bases, nodes, util
@@ -63,12 +62,19 @@ ASTROID_TYPE_COMPARATORS = {
# Dealing with useless override detection, with regard
# to parameters vs arguments
-_CallSignature = collections.namedtuple(
- "_CallSignature", "args kws starred_args starred_kws"
-)
-_ParameterSignature = collections.namedtuple(
- "_ParameterSignature", "args kwonlyargs varargs kwargs"
-)
+
+class _CallSignature(NamedTuple):
+ args: list[str | None]
+ kws: dict[str | None, str | None]
+ starred_args: list[str]
+ starred_kws: list[str]
+
+
+class _ParameterSignature(NamedTuple):
+ args: list[str]
+ kwonlyargs: list[str]
+ varargs: str
+ kwargs: str
def _signature_from_call(call: nodes.Call) -> _CallSignature: