@@ -706,19 +706,19 @@ class Arguments(
706
706
kwargannotation : NodeNG | None
707
707
"""The type annotation for the variable length keyword arguments."""
708
708
709
- vararg_node : NodeNG | None
709
+ vararg_node : AssignName | None
710
710
"""The node for variable length arguments"""
711
711
712
- kwarg_node : NodeNG | None
713
- """The node for keyword arguments"""
712
+ kwarg_node : AssignName | None
713
+ """The node for variable keyword arguments"""
714
714
715
715
def __init__ (
716
716
self ,
717
717
vararg : str | None ,
718
718
kwarg : str | None ,
719
719
parent : NodeNG ,
720
- vararg_node : NodeNG | None = None ,
721
- kwarg_node : NodeNG | None = None ,
720
+ vararg_node : AssignName | None = None ,
721
+ kwarg_node : AssignName | None = None ,
722
722
) -> None :
723
723
"""Almost all attributes can be None for living objects where introspection failed."""
724
724
super ().__init__ (
@@ -803,7 +803,7 @@ def arguments(self):
803
803
* Positional arguments
804
804
* Keyword arguments
805
805
* Variable arguments (.e.g *args)
806
- * Keyword only arguments (e.g **kwargs)
806
+ * Variable keyword arguments (e.g **kwargs)
807
807
"""
808
808
retval = list (itertools .chain ((self .posonlyargs or ()), (self .args or ())))
809
809
if self .vararg_node :
@@ -970,11 +970,7 @@ def is_argument(self, name) -> bool:
970
970
return True
971
971
if name == self .kwarg :
972
972
return True
973
- return (
974
- self .find_argname (name )[1 ] is not None
975
- or self .kwonlyargs
976
- and _find_arg (name , self .kwonlyargs )[1 ] is not None
977
- )
973
+ return self .find_argname (name )[1 ] is not None
978
974
979
975
def find_argname (self , argname , rec = DEPRECATED_ARGUMENT_DEFAULT ):
980
976
"""Get the index and :class:`AssignName` node for given name.
@@ -993,7 +989,7 @@ def find_argname(self, argname, rec=DEPRECATED_ARGUMENT_DEFAULT):
993
989
)
994
990
if self .arguments :
995
991
index , argument = _find_arg (argname , self .arguments )
996
- if argument and argument . name not in [ self . vararg , self . kwarg ] :
992
+ if argument :
997
993
return index , argument
998
994
return None , None
999
995
0 commit comments