# fixhunt regression fixture: ruff TC006, ruff 0.17.1 # the fix labelled safe changes the program's output on this program # before the fix: no stdout, stderr "UnboundLocalError: cannot access local variable 'T' where it is not associated with a value", exit 1 # after the fix: no stdout, stderr "NameError: name 'x' is not defined", exit 1 # finding 2026-10-17T20-41-40-602Z-mapj-ruff-TC006/r1-p003; rule fired 1 time(s) before the fix from typing import cast, List def main(): y = cast(T, x) # Should be cast(str, x) T = list # Now T is the lambda try: print('z:', z) except Exception as e: print('Error after redefinition:', type(e).__name__, str(e)) if __name__ == '__main__': main()