amontalenti / elements-of-python-style

Goes beyond PEP8 to discuss what makes Python code feel great. A Strunk & White for Python.
3.45k stars 258 forks source link

Fixes issue #41 with a reference to f-strings to address issue #41 #42

Open blaisep opened 5 years ago

blaisep commented 5 years ago

@amontalenti , I hope this saves you some time...

F-strings are new in Python 3.6 You may find them easier to compose and to read f"result: {value:{width}.{precision}}". The tradeoffs are localization and security. Python executes f-strings, so they present an additional attack surface: avoid including user-generated data.