@@ -1467,61 +1467,57 @@ def _dp(s, val=None):
14671467 _dp ("visit call, node" , node )
14681468
14691469 called = safe_infer (node .func , compare_constructors = True )
1470- _dp ("a" )
14711470 self ._check_not_callable (node , called )
1472- _dp ("b" )
14731471 try :
1474- _dp ("c" )
14751472 called , implicit_args , callable_name = _determine_callable (called )
1476- _dp ("d" )
14771473 except ValueError :
14781474 # Any error occurred during determining the function type, most of
14791475 # those errors are handled by different warnings.
1480- _dp ("e" )
14811476 return
14821477
1483- _dp ("f" )
1478+ _dp ("Data dump for __init__ call" )
1479+ call_site = astroid .arguments .CallSite .from_call (node )
1480+ num_positional_args = len (call_site .positional_arguments )
1481+ _dp ("node frame" , node .frame ())
1482+ _dp ("isinst" , isinstance (node .frame (), nodes .ClassDef ))
1483+ _dp ("funcdef" , isinstance (called , nodes .FunctionDef ))
1484+ _dp ("called" , called )
1485+ _dp ("frame body" , node .frame ().body )
1486+ _dp ("called in frame body" , called in node .frame ().body )
1487+ _dp ("npa" , num_positional_args )
1488+ _dp ("dec names" , called .decoratornames ())
1489+
14841490 if called .args .args is None :
1485- _dp ("g " )
1491+ _dp ("called.args.args is None " )
14861492 _dp ("called.name" , called .name )
14871493 if called .name == "isinstance" :
14881494 # Verify whether second argument of isinstance is a valid type
1489- _dp ("h" )
14901495 self ._check_isinstance_args (node , callable_name )
14911496 # Built-in functions have no argument information.
1492- _dp ("i " )
1497+ _dp ("Returning now " )
14931498 return
14941499
1495- _dp ("j" )
14961500 if len (called .argnames ()) != len (set (called .argnames ())):
14971501 # Duplicate parameter name (see duplicate-argument). We can't really
14981502 # make sense of the function call in this case, so just return.
1499- _dp ("k" )
15001503 return
15011504
15021505 # Build the set of keyword arguments, checking for duplicate keywords,
15031506 # and count the positional arguments.
1504- _dp ("L" )
15051507 call_site = astroid .arguments .CallSite .from_call (node )
15061508
15071509 # Warn about duplicated keyword arguments, such as `f=24, **{'f': 24}`
1508- _dp ("m" )
15091510 for keyword in call_site .duplicated_keywords :
1510- _dp ("N" )
15111511 self .add_message ("repeated-keyword" , node = node , args = (keyword ,))
15121512
1513- _dp ("O" )
15141513 if call_site .has_invalid_arguments () or call_site .has_invalid_keywords ():
15151514 # Can't make sense of this.
1516- _dp ("p" )
15171515 return
15181516
15191517 # Has the function signature changed in ways we cannot reliably detect?
1520- _dp ("q" )
15211518 if hasattr (called , "decorators" ) and decorated_with (
15221519 called , self .linter .config .signature_mutators
15231520 ):
1524- _dp ("R" )
15251521 return
15261522
15271523 num_positional_args = len (call_site .positional_arguments )
@@ -1553,25 +1549,14 @@ def _dp(s, val=None):
15531549 # inside the class where the function is defined.
15541550 # This avoids emitting `too-many-function-args` since `num_positional_args`
15551551 # includes an implicit `self` argument which is not present in `called.args`.
1556- _dp ("NOTE: about to dec" )
1557- _dp ("node frame" , node .frame ())
1558- _dp ("isinst" , isinstance (node .frame (), nodes .ClassDef ))
1559- _dp ("funcdef" , isinstance (called , nodes .FunctionDef ))
1560- _dp ("called" , called )
1561- _dp ("frame body" , node .frame ().body )
1562- _dp ("called in frame body" , called in node .frame ().body )
1563- _dp ("npa" , num_positional_args )
1564- _dp ("dec names" , called .decoratornames ())
15651552 if (
15661553 isinstance (node .frame (), nodes .ClassDef )
15671554 and isinstance (called , nodes .FunctionDef )
15681555 and called in node .frame ().body
15691556 and num_positional_args > 0
15701557 and "builtins.staticmethod" not in called .decoratornames ()
15711558 ):
1572- _dp ("NOTE: decrementing" )
15731559 num_positional_args -= 1
1574- _dp ("NOTE: dec done" )
15751560
15761561 # Analyze the list of formal parameters.
15771562 args = list (itertools .chain (called .args .posonlyargs or (), called .args .args ))
0 commit comments