# fixhunt regression fixture: ruff RUF019, ruff 0.17.1 # the fix labelled safe changes the program's output on this program # before the fix: stdout "no exception after get", exit 0 # after the fix: no stdout, stderr "AttributeError: 'D' object has no attribute 'get'", exit 1 # finding 2026-10-17T21-39-23-080Z-ah8u-ruff-RUF019/r1-p007; rule fired 1 time(s) before the fix class D: def __contains__(self, k): return k == 'x' def __getitem__(self, k): if k == 'x': raise ValueError('bad') try: return self[k] except ValueError: return default d = D() try: if "x" in d and d["x"]: print("yes after get") except ValueError as e: print("no exception after get")