f2format
f2format copied to clipboard
yield in lambdas mishandled
echo 'type((lambda: (yield))())' | ~/.local/bin/f2format -s
Traceback (most recent call last):
File "/Users/user/.local/bin/f2format", line 8, in <module>
sys.exit(main())
File "<string>", line None
bpc_utils.parsing.BPCSyntaxError: source file '<unknown>' contains the following syntax errors:
[L1C14] SyntaxError: 'yield' outside function
This is yet another false positive from parso. It only checked whether yield is inside a funcdef context, while a lambdef context should also be acceptable.