Skip to content

string: Convert string module to package and import templatelib.#1096

Merged
dpgeorge merged 1 commit intomicropython:masterfrom
dpgeorge:string-make-module
Mar 23, 2026
Merged

string: Convert string module to package and import templatelib.#1096
dpgeorge merged 1 commit intomicropython:masterfrom
dpgeorge:string-make-module

Conversation

@dpgeorge
Copy link
Copy Markdown
Member

Convert the existing string module into a package with __init__.py and templatelib.py. This is needed to support t-strings (if they are enabled) because there is a built-in string.templatelib module with built-in Template and Interpolation classes.

@dpgeorge
Copy link
Copy Markdown
Member Author

Tested with main micropython repo, using the webassembly port (pyscript variant, which has t-strings enabled and this string package frozen into it) and also the unix coverage variant.

Convert the existing `string` module into a package with `__init__.py`
and `templatelib.py`.  This is needed to support t-strings (if they are
enabled) because there is a built-in `string.templatelib` module with
built-in `Template` and `Interpolation` classes.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge force-pushed the string-make-module branch from 9e8197c to 8380c7b Compare March 23, 2026 00:17
@dpgeorge dpgeorge merged commit 8380c7b into micropython:master Mar 23, 2026
5 checks passed
@dpgeorge dpgeorge deleted the string-make-module branch March 23, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant