diff options
author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2021-12-05 13:03:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-05 13:03:21 +0100 |
commit | 8ea31c8f197c3f4c1fefdbf861530c831d250a59 (patch) | |
tree | 1e6964c790b747ccf4868d2722f8db7a81e4cd40 | |
parent | 6691a9e97373b28e15a76b747f78c041f2064df4 (diff) | |
download | astroid-git-8ea31c8f197c3f4c1fefdbf861530c831d250a59.tar.gz |
Fix typing of Arguments.args (#1283)
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | astroid/nodes/node_classes.py | 9 |
2 files changed, 9 insertions, 2 deletions
@@ -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.""" |