The following f-string does not parse and gives syntax error on 3.11.3:

f'thruput/{"user" if opt.return else "cell"} vs. elevation\n'

However this expression, which is similar does parse correctly:

f'thruput/{"user" if True else "cell"} vs. elevation\n'

I don't see any workaround.  Parenthesizing doesn't help:
 f'thruput/{"user" if (opt.return) else "cell"} vs. elevation\n'

also gives a syntax error
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to