# fixhunt regression fixture: ruff RUF019, ruff 0.17.1 # the fix labelled safe changes the program's output on this program # before the fix: no stdout, exit 0 # after the fix: no stdout, stderr "AttributeError: 'P' object has no attribute 'get'", exit 1 # finding 2026-10-17T21-39-23-080Z-ah8u-ruff-RUF019/r1-p002; rule fired 1 time(s) before the fix import os import tempfile with tempfile.TemporaryDirectory() as td: p = os.path.join(td, 'link') class P: def __contains__(self, k): return os.path.exists(p) if k == 'x' else False def __getitem__(self, k): raise KeyError(k) d = P() if "x" in d and d["x"]: print("falsy")