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

Revert "Remove useless NoReturn in NodeNG.statement's typing (#1304)" #1307

Merged
merged 1 commit into from
Dec 27, 2021
Merged
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
7 changes: 6 additions & 1 deletion astroid/nodes/node_ng.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
if TYPE_CHECKING:
from astroid import nodes

if sys.version_info >= (3, 6, 2):
from typing import NoReturn
else:
from typing_extensions import NoReturn

if sys.version_info >= (3, 8):
from typing import Literal
else:
Expand Down Expand Up @@ -284,7 +289,7 @@ def statement(self, *, future: Literal[True]) -> "nodes.Statement":

def statement(
self, *, future: Literal[None, True] = None
) -> Union["nodes.Statement", "nodes.Module"]:
) -> Union["nodes.Statement", "nodes.Module", "NoReturn"]:
"""The first parent node, including self, marked as statement node.

TODO: Deprecate the future parameter and only raise StatementMissing and return
Expand Down