Working on PEP 750 (Template Strings) support - interested in feedback #17497
Unanswered
koxudaxi
asked this question in
Core Development
Replies: 2 comments 1 reply
-
Thanks a lot for this 🤩 and not my call, but:
/cc @dpgeorge |
Beta Was this translation helpful? Give feedback.
0 replies
-
Nice to have :-) I would do it so that Micropython only knows the syntax, but the library has to be installed separately. We have to keep in mind that the firmware must not become too large. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I've been playing around with implementing PEP 750 template strings in MicroPython. For those unfamiliar, these are the new t-strings coming in Python 3.14:
You can already try them in CPython 3.14.0b2 or in this browser playground: https://t-strings.help/playground.html
My motivation is that I want to use template strings with PyScript for building reactive web UIs (think React, but in Python - the tdom library shows what's possible). The playground above uses a patched Pyodide build which works but is quite heavy - a MicroPython WASM build would be much more suitable for browser environments.
I've got a basic implementation working on the unix port:
Everything builds and the tests pass when
MICROPY_PY_TSTRINGS
is enabled. When disabled, there's zero impact on code size.Before I go further and clean things up for a PR, I wanted to check:
I know new features need discussion first, so here I am :)
Links:
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions