Skip to content

Commit 1edb51b

Browse files
cdce8ptushar-deepsource
authored andcommitted
Fix node.statement overload typing (pylint-dev#1308)
1 parent 4a1853d commit 1edb51b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

astroid/nodes/node_ng.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,7 @@ def parent_of(self, node):
272272
return any(self is parent for parent in node.node_ancestors())
273273

274274
@overload
275-
def statement(
276-
self, *, future: Literal[None] = ...
277-
) -> Union["nodes.Statement", "nodes.Module"]:
275+
def statement(self) -> Union["nodes.Statement", "nodes.Module"]:
278276
...
279277

280278
@overload

astroid/nodes/scoped_nodes/scoped_nodes.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -658,9 +658,11 @@ def fully_defined(self):
658658
return self.file is not None and self.file.endswith(".py")
659659

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

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

0 commit comments

Comments
 (0)