Yup, especially as you often need to access dict's with foo["field"] and you get a syntax error if the f-strings is also f"". JavaScript backtick syntax doesn't lead to this extra syntactic friction.
f"{foo['field']}"
f'{foo["field"]}'
f"""{foo["field"]}"""
(I see from your carefully worded first sentence that you already knew this but still find it annoying, but I'll leave this here for any that aren't aware.)[0] https://github.com/psf/black/blob/master/docs/the_black_code...
$ echo "'foo'" | black -
"foo"
$ echo "'foo[\"bar\"]'" | black -
'foo["bar"]'
$ echo "'foo[\"bar\"]+\\'baz\\''" | black -
"foo[\"bar\"]+'baz'"Since this:
"this is a "regular" string"
isn't valid, then neither is this:
f"dict lookup: {d["key"]}"
However, we've talked about changing f-string parsing from a "post-process regular strings" mode, to instead having the tokenizer and parser themselves aware of f-strings. When we do that, the f-string example above will work.
(edit for formatting)