Skip to content

Commit 144cb73

Browse files
committed
Fix annotations for statement method
1 parent a82d9d9 commit 144cb73

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

astroid/nodes/node_ng.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
if TYPE_CHECKING:
4848
from astroid import nodes
49+
from astroid.nodes import _base_nodes
4950

5051

5152
# Types for 'NodeNG.nodes_of_class()'
@@ -278,7 +279,7 @@ def parent_of(self, node) -> bool:
278279
"""
279280
return any(self is parent for parent in node.node_ancestors())
280281

281-
def statement(self, *, future: Literal[None, True] = None) -> nodes.Statement:
282+
def statement(self, *, future: Literal[None, True] = None) -> _base_nodes.Statement:
282283
"""The first parent node, including self, marked as statement node.
283284
284285
:raises StatementMissing: If self has no parent attribute.
@@ -290,7 +291,7 @@ def statement(self, *, future: Literal[None, True] = None) -> nodes.Statement:
290291
stacklevel=2,
291292
)
292293
if self.is_statement:
293-
return cast("nodes.Statement", self)
294+
return cast("_base_nodes.Statement", self)
294295
if not self.parent:
295296
raise StatementMissing(target=self)
296297
return self.parent.statement()

0 commit comments

Comments
 (0)