From 755c999abeea1e2a287a6696b638901564037658 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Tue, 28 Dec 2021 00:03:13 +0100 Subject: [PATCH] Fix node.statement overload typing - default argument --- astroid/nodes/node_ng.py | 4 +++- astroid/nodes/scoped_nodes/scoped_nodes.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/astroid/nodes/node_ng.py b/astroid/nodes/node_ng.py index 80f087c42f..5eb6d1985c 100644 --- a/astroid/nodes/node_ng.py +++ b/astroid/nodes/node_ng.py @@ -278,7 +278,9 @@ def parent_of(self, node): return any(self is parent for parent in node.node_ancestors()) @overload - def statement(self) -> Union["nodes.Statement", "nodes.Module"]: + def statement( + self, *, future: Literal[None] = ... + ) -> Union["nodes.Statement", "nodes.Module"]: ... @overload diff --git a/astroid/nodes/scoped_nodes/scoped_nodes.py b/astroid/nodes/scoped_nodes/scoped_nodes.py index 70070ce3d6..c045c99e1d 100644 --- a/astroid/nodes/scoped_nodes/scoped_nodes.py +++ b/astroid/nodes/scoped_nodes/scoped_nodes.py @@ -658,7 +658,7 @@ def fully_defined(self): return self.file is not None and self.file.endswith(".py") @overload - def statement(self) -> "Module": + def statement(self, *, future: Literal[None] = ...) -> "Module": ... # pylint: disable-next=arguments-differ