This article describe new updates of f-string on python3.12
TIL that python3.12 (PEP701) will remove some restrictions on the usage of
f-strings, such as, reusing the same quotes as the containing f-string,
allowing usage of backslashes and unicode escaped sequences inside f-strings.
Personally I prefer using double quotes " " for all my python strings.
However, before python 3.12, we are not allowed to use the same quotes inside a
f-string:
This also means that, before this changes, f-strings can be nested only if we
are using different string quotes, like:
Now it is possible to write nested f-strings with the same quotes:
Another thing that I like about python 3.12 f-string is that we can use
backlashes and unicode escaped sequences. The following example is taken
from the official PEP changelog: