Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 17, 2025
1 parent b495cd4 commit 88e3449
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pylint/checkers/typecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -1488,14 +1488,17 @@ def _dp(s, val=None):
# _dp("isinst", isinstance(node.frame(), nodes.ClassDef))
# _dp("funcdef", isinstance(called, nodes.FunctionDef))
_dp("called", called)
_dp("bound method init in called", "BoundMethod __init__ of builtins.object" in str(called))
_dp(
"bound method init in called",
"BoundMethod __init__ of builtins.object" in str(called),
)
_dp("called.args", called.args)
_dp("frame body", node.frame().body)
# _dp("called in frame body", called in node.frame().body)
# _dp("dec names", called.decoratornames())

Check notice on line 1498 in pylint/checkers/typecheck.py

View workflow job for this annotation

GitHub Actions / pylint

C0401

Wrong spelling of a word 'decoratornames' in a comment:

def _call_site_has_args(cs):
"True if any args passed."
"""True if any args passed."""
has_args = (
False
or len(cs.positional_arguments) > 0
Expand All @@ -1514,7 +1517,9 @@ def _call_site_has_args(cs):
# is handled elsewhere.
if "BoundMethod __init__ of builtins.object" in str(called):
if _call_site_has_args(call_site):
self.add_message("too-many-function-args", node=node, args=("__init__",))
self.add_message(
"too-many-function-args", node=node, args=("__init__",)
)
return

if len(called.argnames()) != len(set(called.argnames())):
Expand Down

0 comments on commit 88e3449

Please sign in to comment.