Using a function named cast (shadows a newish builtin) leads to somewhat confusing errors. For the test file:
from something import cast
# same with `def cast(s): pass`
abc = "123"
cast(f"tuv {abc} xyz")
We get the following unexpected results:
$ ruff tmp.py
Found 2 error(s).
tmp.py:5:6: F722 Syntax error in forward annotation: ` xyz`
tmp.py:5:6: F821 Undefined name `tuv`
I'm not quite sure what the best resolution is, maybe a warning on imports/defs that shadow cast?