Skip to content

Commit

Permalink
Fix node.statement overload typing (#1308)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p authored Dec 22, 2021
1 parent e41a896 commit 7d3b41c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions astroid/nodes/node_ng.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,7 @@ def parent_of(self, node):
return any(self is parent for parent in node.node_ancestors())

@overload
def statement(
self, *, future: Literal[None] = ...
) -> Union["nodes.Statement", "nodes.Module"]:
def statement(self) -> Union["nodes.Statement", "nodes.Module"]:
...

@overload
Expand Down
4 changes: 3 additions & 1 deletion astroid/nodes/scoped_nodes/scoped_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,9 +658,11 @@ def fully_defined(self):
return self.file is not None and self.file.endswith(".py")

@overload
def statement(self, *, future: Literal[None] = ...) -> "Module":
def statement(self) -> "Module":
...

# pylint: disable-next=arguments-differ
# https://github.com/PyCQA/pylint/issues/5264
@overload
def statement(self, *, future: Literal[True]) -> NoReturn:
...
Expand Down

0 comments on commit 7d3b41c

Please sign in to comment.