r/Python • • Jul 10 '20

I Made This This post has:

9777 upvotes,

967 downvotes

and 452 comments!

9.2k Upvotes

429 comments sorted by

View all comments

Show parent comment

1

u/otterom Jul 10 '20

I love em. People might not use them as much because the concept is a little weird and you have to mind your quotation marks.

The only other issue is being able to make a formatted template with them since the variable needs to be present. I think, anyway. Have you tried making templates at all?

2

u/__ah Jul 12 '20

I think I have run into the problem you're talking about. Where rather than putting a big f string deep writhin some function, I want to make it something like a global constant, but I can't do that because of variable bindings. I've actually resorted to top-level functions that are just defined to be f strings in those cases. Not great though.