Closed as duplicate
Description
value
here is always defined because exit
is NoReturn
, but ty
reports it as possibly not defined.
import random
if random.random() > 0.5:
exit(0)
else:
value = 1
print(value)
See: https://types.ruff.rs/eef5be97-af38-4588-9c25-4fd69565baa3