Add t-string support
- Dominant language
- Python
- Stars
- 917
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
Looking at the various `air.Tag`-style classes made me wonder whether you plan to support Python 3.14's t-strings.
With t-string support, this:
```python
@app.get("/")
def landing_page():
title = "Awesome SaaS"
header = air.H1("Awesome SaaS")
raw_html = "Raw HTML"
return air.Html(
air.Head(air.Title(title)),
air.Body(
header,
air.P(air.A("API Docs", target="_blank", href="/api/docs")),
air.P(air.Raw(raw_html),
),
)
```
Might optionally be written as this:
```python
@app.get("/")
def landing_page():
title = "Awesome SaaS"
header = air.H1("Awesome SaaS")
raw_html = "Raw HTML"
return air.Html(t"""
{title}
{header}
{raw_html:safe}
""")
```
That would require some parsing logic to determine the appropriate `air.Tag` subclass to use for each `` used.
Feel free to close/move this issue if it's off topic or not a priority. I just wanted to bring this idea to your attention in case it hadn't been considered and subsequently ruled out yet.
Contributor guide
Research direction
Review Python 3.14 t-string behavior alongside the existing air.Tag-style classes; the issue names no files or tests to start from. Done would require a settled scope for parsing HTML tags into appropriate air.Tag subclasses and, if accepted, tests demonstrating the proposed behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100