From 8ea31c8f197c3f4c1fefdbf861530c831d250a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sun, 5 Dec 2021 13:03:21 +0100 Subject: Fix typing of Arguments.args (#1283) --- ChangeLog | 2 ++ astroid/nodes/node_classes.py | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a5a34cd..7d701440 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,8 @@ Release date: TBA Closes #1260 +* Fix typing and update explanation for ``Arguments.args`` being ``None``. + What's New in astroid 2.9.0? ============================ diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py index 295f7d8c..ef6c52f4 100644 --- a/astroid/nodes/node_classes.py +++ b/astroid/nodes/node_classes.py @@ -858,8 +858,13 @@ class Arguments(mixins.AssignTypeMixin, NodeNG): self.kwarg: Optional[str] = kwarg # can be None """The name of the variable length keyword arguments.""" - self.args: typing.List[AssignName] - """The names of the required arguments.""" + self.args: typing.Optional[typing.List[AssignName]] + """The names of the required arguments. + + Can be None if the assosciated function does not have a retrievable + signature and the arguments are therefore unknown. + This happens with builtin functions implemented in C. + """ self.defaults: typing.List[NodeNG] """The default values for arguments that can be passed positionally.""" -- cgit v1.2.1