Nested f-strings
问题 Thanks to David Beazley's tweet, I've recently found out that the new Python 3.6 f-strings can also be nested: >>> price = 478.23 >>> f"{f'${price:0.2f}':*>20s}" '*************$478.23' Or: >>> x = 42 >>> f'''-{f"""*{f"+{f'.{x}.'}+"}*"""}-''' '-*+.42.+*-' While I am surprised that this is possible, I am missing on how practical is that, when would nesting f-strings be useful? What use cases can this cover? Note: The PEP itself does not mention nesting f-strings, but there is a specific test