Is there a way to include a comment in an f-string?
It would be useful for me to include a comment in an f-string. For instance, take this code: f""" <a href="{ escape(url) }" target="_blank" { # users expect link to open in new tab } >bla</a> """ It would be nice if this code was equivalent to: f""" <a href="{ escape(url) }" target="_blank" >bla</a> """ You can include full Python expressions in between the curly braces, but it looks like you can't include comments. Am I correct? Is there a way to do this?
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.