-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
bugmypy got something wrongmypy got something wrongtopic-reachabilityDetecting unreachable codeDetecting unreachable code
Description
Really strange behavior here, when this statement is on the module level it creates a silently unreachable branch, but when in a scope it doesn't create unreachable
import sys
def foo() -> None:
assert sys.platform == "AMONGUS"
a # error, reachable ❌
cond: bool
if cond:
assert sys.platform == "AMONGUS"
a # error, reachable ❌
assert sys.platform == "AMONGUS"
a # no error, silent unreachable ✅
DetachHead
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-reachabilityDetecting unreachable codeDetecting unreachable code