diff --git a/astroid/bases.py b/astroid/bases.py index 4a684cf1fe..4a0d152656 100644 --- a/astroid/bases.py +++ b/astroid/bases.py @@ -147,7 +147,7 @@ def _infer_stmts( stmts: Iterable[InferenceResult], context: InferenceContext | None, frame: nodes.NodeNG | BaseInstance | None = None, -) -> collections.abc.Generator[InferenceResult, None, None]: +) -> collections.abc.Generator[InferenceResult]: """Return an iterator on statements inferred by each statement in *stmts*.""" inferred = False constraint_failed = False @@ -354,7 +354,7 @@ def infer_binary_op( other: InferenceResult, context: InferenceContext, method: SuccessfulInferenceResult, - ) -> Generator[InferenceResult, None, None]: + ) -> Generator[InferenceResult]: return method.infer_call_result(self, context) def __repr__(self) -> str: @@ -491,9 +491,7 @@ def _infer_builtin_new( self, caller: SuccessfulInferenceResult | None, context: InferenceContext, - ) -> collections.abc.Generator[ - nodes.Const | Instance | UninferableBase, None, None - ]: + ) -> collections.abc.Generator[nodes.Const | Instance | UninferableBase]: if not isinstance(caller, nodes.Call): return if not caller.args: diff --git a/astroid/exceptions.py b/astroid/exceptions.py index dd78a81ffe..126acb954d 100644 --- a/astroid/exceptions.py +++ b/astroid/exceptions.py @@ -230,7 +230,7 @@ class InferenceError(ResolveError): # pylint: disable=too-many-instance-attribu context: InferenceContext object. """ - def __init__( # pylint: disable=too-many-arguments + def __init__( # pylint: disable=too-many-arguments, too-many-positional-arguments self, message: str = "Inference failed for {node!r}.", node: InferenceResult | None = None, diff --git a/astroid/nodes/_base_nodes.py b/astroid/nodes/_base_nodes.py index 96c3c1c06d..2d210f17af 100644 --- a/astroid/nodes/_base_nodes.py +++ b/astroid/nodes/_base_nodes.py @@ -42,7 +42,7 @@ InferenceContext, InferenceContext, ], - list[partial[Generator[InferenceResult, None, None]]], + list[partial[Generator[InferenceResult]]], ] diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py index 60d9e0e94c..18df0d7e7b 100644 --- a/astroid/nodes/node_classes.py +++ b/astroid/nodes/node_classes.py @@ -82,7 +82,7 @@ def _is_const(value) -> bool: ] InferBinaryOperation = Callable[ [_NodesT, Optional[InferenceContext]], - Generator[Union[InferenceResult, _BadOpMessageT], None, None], + Generator[Union[InferenceResult, _BadOpMessageT]], ] InferLHS = Callable[ [_NodesT, Optional[InferenceContext]], @@ -737,7 +737,7 @@ def __init__( self.vararg_node = vararg_node self.kwarg_node = kwarg_node - # pylint: disable=too-many-arguments + # pylint: disable=too-many-arguments, too-many-positional-arguments def postinit( self, args: list[AssignName] | None, diff --git a/astroid/nodes/scoped_nodes/scoped_nodes.py b/astroid/nodes/scoped_nodes/scoped_nodes.py index 5309f0a0d2..81c4d8dd20 100644 --- a/astroid/nodes/scoped_nodes/scoped_nodes.py +++ b/astroid/nodes/scoped_nodes/scoped_nodes.py @@ -1837,7 +1837,7 @@ def get_wrapping_class(node): return klass -class ClassDef( # pylint: disable=too-many-instance-attributes +class ClassDef( _base_nodes.FilterStmtsBaseNode, LocalsDictNodeNG, _base_nodes.Statement ): """Class representing an :class:`ast.ClassDef` node. diff --git a/astroid/typing.py b/astroid/typing.py index 27d95c21fb..77cc120306 100644 --- a/astroid/typing.py +++ b/astroid/typing.py @@ -76,7 +76,7 @@ class AstroidManagerBrain(TypedDict): "InferenceContext", SuccessfulInferenceResult, ], - Generator[InferenceResult, None, None], + Generator[InferenceResult], ] diff --git a/pylintrc b/pylintrc index d41efd13ef..12a01eb568 100644 --- a/pylintrc +++ b/pylintrc @@ -307,6 +307,9 @@ exclude-protected=_asdict,_fields,_replace,_source,_make # Maximum number of arguments for function / method max-args=10 +# Maximum number of positional arguments for function / method. +max-positional-arguments=8 + # Argument names that match this expression will be ignored. Default to name # with leading underscore