You should indeed feel vindicated. Me too, I've been a paid subscriber for months and eagerly read every word. <wink> But yes, I feel like this is the first of several vindications you have coming.
As an FYI, I'm with the template strings folks (new feature in 3.14) and we're building an HTML system around the idea of JSX-style components as callables, but with actual strings of HTML. Check our <a…
Quick comment, our AI Chat now has Claude integration. Don't need the Anthropic plugin.
Thanks for the kind words, but really, I'm over-sung on this. It's been a long time since I impacted Python. I should be participating more. Hopefully t-strings is the place.
Guido said for many years (decades) that he wanted to get back to the parser.
As an example of t-strings helping SQL, Phil Jones published a package [1] that illustrates how it could work. [1] https://github.com/pgjones/sql-tstring
Do t-strings miss something that f-strings provides for format_spec etc.? FWIW, format_spec is available in the template structure, so the function writer could at least do a runtime check.
I'm one of the PEP authors and also with JetBrains. I'm talking to the PyCharm team about this.
Some prior art: https://pypi.org/project/tagged/ In fact, the repo of a companion project from the author has the ticket that spawned the work leading to t-strings: https://github.com/jviide/htm.py/issues/11
This is what we discussed in the first revision of the PEP (the use of `Annotated`.) But we found out: linters don't know anything about the Python type system. We hope to get a community around all of this, stuff at…
The PEP originally portrayed this as "for DSLs"
Thanks Nick for this response and all the time you've spent explaining. It's funny, I looked back at the comments on f-strings before they landed. They also got similar complaints about bloat. And yet, my uneducated…
The other PEP example shows generating HTML attributes from a passed-in dictionary. HTML has a number of places where this is helpful, if you have original data.
Nearly everything you just described is being worked on. It's amazing how accurately you have described it. We hope to demo and explain at PyCon US.
It was discussed in the first revision and discussion of the PEP. The decision was made to move that to follow-on work, as we discovered more about what tooling needs. As an example, I was excited about using…
The original PEP and the original discussion had this in scope. We removed it to let this emerge later. There are different ways to signal the language -- some more friendly to tooling, some more robust.
We've come a long way with AI Assistant in the last few months. Lots more planned.
That's cool that you're looking at those things. I hope we've made progress on "Apply" (and we're doing more.) And as heads-up, as you can imagine, we're looking at NEP.
(I'm from JetBrains.) Let's just say, watch this space.
I'd like to add, after the first publication for discussion, we got some wonderful involvement from Andrea Giammarchi who brought his deep JS libraries and tools experience into the PEP. In fact, he's deeply involved in…
If the string is an f-string, it is immediately evaluated and you no longer have access to the interpolation info for a resolver. If the string is not an f-string, you get no help from Python tooling. In both cases, you…
If I understand correctly, you'd prefer what other commenters have said for `html(i"Hello {name}")`?
(PEP co-author here.) You've described it well. As the "How to teach it section" emphasizes, we'd like consumers of tag functions to just think of it as an f-string with other stuff that happens before evaluation. From…
Cool to see you jump in, Ian. I don't particularly mind the prefix thing. It came up in the PEP discussion, as did choice of backticks to indicate this is different. But JS template literals -> tagged template literals…
Doing `html('<div>Hello {name}</div>')` would be possible. I have a system that's based on it. Two issues: - No tooling in Python will do anything with the string, so DX suffers. - Evaluating the variable requires frame…
You should indeed feel vindicated. Me too, I've been a paid subscriber for months and eagerly read every word. <wink> But yes, I feel like this is the first of several vindications you have coming.
As an FYI, I'm with the template strings folks (new feature in 3.14) and we're building an HTML system around the idea of JSX-style components as callables, but with actual strings of HTML. Check our <a…
Quick comment, our AI Chat now has Claude integration. Don't need the Anthropic plugin.
Thanks for the kind words, but really, I'm over-sung on this. It's been a long time since I impacted Python. I should be participating more. Hopefully t-strings is the place.
Guido said for many years (decades) that he wanted to get back to the parser.
As an example of t-strings helping SQL, Phil Jones published a package [1] that illustrates how it could work. [1] https://github.com/pgjones/sql-tstring
Do t-strings miss something that f-strings provides for format_spec etc.? FWIW, format_spec is available in the template structure, so the function writer could at least do a runtime check.
I'm one of the PEP authors and also with JetBrains. I'm talking to the PyCharm team about this.
Some prior art: https://pypi.org/project/tagged/ In fact, the repo of a companion project from the author has the ticket that spawned the work leading to t-strings: https://github.com/jviide/htm.py/issues/11
This is what we discussed in the first revision of the PEP (the use of `Annotated`.) But we found out: linters don't know anything about the Python type system. We hope to get a community around all of this, stuff at…
The PEP originally portrayed this as "for DSLs"
Thanks Nick for this response and all the time you've spent explaining. It's funny, I looked back at the comments on f-strings before they landed. They also got similar complaints about bloat. And yet, my uneducated…
The other PEP example shows generating HTML attributes from a passed-in dictionary. HTML has a number of places where this is helpful, if you have original data.
Nearly everything you just described is being worked on. It's amazing how accurately you have described it. We hope to demo and explain at PyCon US.
It was discussed in the first revision and discussion of the PEP. The decision was made to move that to follow-on work, as we discovered more about what tooling needs. As an example, I was excited about using…
The original PEP and the original discussion had this in scope. We removed it to let this emerge later. There are different ways to signal the language -- some more friendly to tooling, some more robust.
We've come a long way with AI Assistant in the last few months. Lots more planned.
That's cool that you're looking at those things. I hope we've made progress on "Apply" (and we're doing more.) And as heads-up, as you can imagine, we're looking at NEP.
(I'm from JetBrains.) Let's just say, watch this space.
I'd like to add, after the first publication for discussion, we got some wonderful involvement from Andrea Giammarchi who brought his deep JS libraries and tools experience into the PEP. In fact, he's deeply involved in…
If the string is an f-string, it is immediately evaluated and you no longer have access to the interpolation info for a resolver. If the string is not an f-string, you get no help from Python tooling. In both cases, you…
If I understand correctly, you'd prefer what other commenters have said for `html(i"Hello {name}")`?
(PEP co-author here.) You've described it well. As the "How to teach it section" emphasizes, we'd like consumers of tag functions to just think of it as an f-string with other stuff that happens before evaluation. From…
Cool to see you jump in, Ian. I don't particularly mind the prefix thing. It came up in the PEP discussion, as did choice of backticks to indicate this is different. But JS template literals -> tagged template literals…
Doing `html('<div>Hello {name}</div>')` would be possible. I have a system that's based on it. Two issues: - No tooling in Python will do anything with the string, so DX suffers. - Evaluating the variable requires frame…