3 ms·
What if you wanted to append a string with braces, could you? (I don’t know Python!) Plus it would lead to subtle security vulns and other bugs. A contrived
by carl_dr 4y ago
What if you wanted to append a string with braces, could you? (I don’t know Python!)
Plus it would lead to subtle security vulns and other bugs. A contrived example :
f”{bot} spammed my repo saying” + “touch(‘{path}’) was wrong lol.”
Now my path var has been disclosed.
- bikingbismuth 4y agoIf you want braces in your f strings you double them up. Ex: n = "hn" print(f"hello {n} your path is {{path}}") Out: hello hn your path is {path}