Ubuntu – How to tackle "Statement is unreachable [unreachable]" with mypy when setting attribute value in a method?
Problem description Suppose a following test class Foo: def __init__(self): self.value: int | None = None def set_value(self, value: int | None): self.value = value def test_foo(): foo = Foo() assert foo.value is None foo.set_value(1) assert isinstance(foo.value, int) assert foo.value…