-
-
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
Bug Report
To Reproduce
class Foo:
def foo(self) -> None:
print("Foo!!!")
class Bar:
def __init__(self) -> None:
self.foo: Foo | None = Foo()
def get_rid_of_foo(self) -> None:
self.foo = None
bar = Bar()
if bar.foo is not None:
bar.get_rid_of_foo()
assert bar.foo is None
print(1 + "lol")
Expected Behavior
An error for the obviously wrong print(1 + "lol")
. It fails there at runtime.
Actual Behavior
no errors!
Your Environment
mypy 0.942 with --python-version 3.10
treiher
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-reachabilityDetecting unreachable codeDetecting unreachable code