-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed as not planned
Labels
featureneeds discussionpriority-2-lowtopic-reachabilityDetecting unreachable codeDetecting unreachable code
Description
test.py:
from contextlib import ExitStack
def context_manager_with_return_bug() -> int:
with ExitStack() as stack:
return 5
mypy complains: test.py:3: error: Missing return statement
Oddly this only seems to happen when using ExitStack specifically - no other context manager, based on other functions / classes / etc, in my codebase triggers this bug.
jamesderlin, eric-wieser, igor-petrik-invitae and JulianJvn
Metadata
Metadata
Assignees
Labels
featureneeds discussionpriority-2-lowtopic-reachabilityDetecting unreachable codeDetecting unreachable code