[SOLVED] Syntax highlighting for python "fstrings"


Hi guys

i’m just playing around with python 3.6 “fstrings” and noticed that they will not get highlighted correctly

print(f"foo {x}")

i’ve installed MagicPython and got this now:

while this is better than the default highlighting package (it now highlights the brackets) it does still not highlight the leading “f”.

Anyone found another package or tweak for this?

greetings mosss



It is identified correctly, just not coloured with an individual colouring.
Try the following in your style sheet (styles.less) -

.syntax--storage.syntax--type.syntax--string.syntax--python.string.syntax--quoted.syntax--single.syntax--python.string.syntax--interpolated.syntax--python {
  color: yellow




Did you notify the authors of those highlighting package of the change?


To whom did you direct this question to?

From my side I should mention that my suggestion was directed to the custom user style sheet and not to the one in the package. I should not have assumed that the topic starter would know that this is what I aimed for.

The MagicPython package already identify the syntax. It is the theme that needs to make provision for this change “new” syntax addition.


worked perfectly ty! :slight_smile:


am i blind or is there really no “accept answer” / “close topic”-like function on this Forum? :smile:


Your ‘eye-sight’ is 20:20.
You could change the title of the topic. Perhaps add (Solved) to the title.