-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugmypy got something wrongmypy got something wrongtopic-reachabilityDetecting unreachable codeDetecting unreachable code
Description
from typing import Any
def main(contents: Any, commit: str | None) -> None:
if (
contents.get("commit") == commit
and (commit is not None or print("can_be_reached"))
):
pass
main({"commit": None}, None)
mypy 1.19.1 with --warn-unreachable gives main.py:6: error: Right operand of "or" is never evaluated [unreachable]
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-reachabilityDetecting unreachable codeDetecting unreachable code