Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manadatory fields for Await #2096

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Release date: TBA
- ``nodes.AssignName``
- ``nodes.Attribute``
- ``nodes.AugAssign``
- ``nodes.Await``
- ``nodes.BinOp``
- ``nodes.Compare``
- ``nodes.Delete``
Expand Down
40 changes: 3 additions & 37 deletions astroid/nodes/node_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2534,44 +2534,10 @@ async def func(things):

_astroid_fields = ("value",)

def __init__(
self,
lineno: int | None = None,
col_offset: int | None = None,
parent: NodeNG | None = None,
*,
end_lineno: int | None = None,
end_col_offset: int | None = None,
) -> None:
"""
:param lineno: The line that this node appears on in the source code.

:param col_offset: The column that this node appears on in the
source code.

:param parent: The parent node in the syntax tree.

:param end_lineno: The last line this node appears on in the source code.

:param end_col_offset: The end column this node appears on in the
source code. Note: This is after the last symbol.
"""
self.value: NodeNG | None = None
"""What to wait for."""

super().__init__(
lineno=lineno,
col_offset=col_offset,
end_lineno=end_lineno,
end_col_offset=end_col_offset,
parent=parent,
)

def postinit(self, value: NodeNG | None = None) -> None:
"""Do some setup after initialisation.
value: NodeNG
"""What to wait for."""

:param value: What to wait for.
"""
def postinit(self, value: NodeNG) -> None:
self.value = value

def get_children(self):
Expand Down