Skip to content

Commit 8ea31c8

Browse files
authored
Fix typing of Arguments.args (#1283)
1 parent 6691a9e commit 8ea31c8

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Release date: TBA
1818

1919
Closes #1260
2020

21+
* Fix typing and update explanation for ``Arguments.args`` being ``None``.
22+
2123

2224
What's New in astroid 2.9.0?
2325
============================

astroid/nodes/node_classes.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,8 +858,13 @@ def __init__(
858858
self.kwarg: Optional[str] = kwarg # can be None
859859
"""The name of the variable length keyword arguments."""
860860

861-
self.args: typing.List[AssignName]
862-
"""The names of the required arguments."""
861+
self.args: typing.Optional[typing.List[AssignName]]
862+
"""The names of the required arguments.
863+
864+
Can be None if the assosciated function does not have a retrievable
865+
signature and the arguments are therefore unknown.
866+
This happens with builtin functions implemented in C.
867+
"""
863868

864869
self.defaults: typing.List[NodeNG]
865870
"""The default values for arguments that can be passed positionally."""

0 commit comments

Comments
 (0)