Skip to content
Next Next commit
Fix: Add 't' prefix to stringprefix regex to support Python 3.14 temp…
…late strings
  • Loading branch information
Anuradha-Agrawal-07 committed Oct 8, 2025
commit bf944584759326d24efef9676f6427a4c84746a8
3 changes: 2 additions & 1 deletion Lib/idlelib/colorizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def make_pat():
name not in keyword.kwlist]
builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b"
comment = any("COMMENT", [r"#[^\n]*"])
stringprefix = r"(?i:r|u|f|fr|rf|b|br|rb)?"
# Added 't' prefix and other combinations to support Python 3.14 template strings (PEP 701)
Comment thread
ambv marked this conversation as resolved.
Outdated
stringprefix = r"(?i:r|u|f|t|fr|rf|b|br|rb|rt|tr)?"
Comment thread
ambv marked this conversation as resolved.
Outdated
sqstring = stringprefix + r"'[^'\\\n]*(\\.[^'\\\n]*)*'?"
dqstring = stringprefix + r'"[^"\\\n]*(\\.[^"\\\n]*)*"?'
sq3string = stringprefix + r"'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?"
Expand Down