
Hello Python Devs,
In accordance to PEP 0, I am looking for a Python-core-developer to sponsor my new PEP. It is essentially a revisit of PEP 501. https:// github.com/nhumrich/peps/blob/master/pep-9999.rst https://t.co/cCrqfWztAW?amp=1
Please let me know if you have questions, or would be interested in sponsoring this PEP.
Nick Humrich

On Wed, Jul 14, 2021 at 8:50 AM Nick Humrich nick@humrich.us wrote:
In accordance to PEP 0, I am looking for a Python-core-developer to sponsor my new PEP. It is essentially a revisit of PEP 501. https:// github.com/nhumrich/peps/blob/master/pep-9999.rst https://t.co/cCrqfWztAW?amp=1
By immediately calling format on your t-strings in your examples you obfuscate what this is doing. Here's a better example:
age = 50 x = t'My age is {age}.' format(x)
"My age is 50."
age = 51 format(x)
"My age is 50."
And what about this:
ages = [50] x = t'My age is {ages[0]}.' format(x)
"My age is 50."
ages[0] = 51 format(x)
???
However, the problem you are trying to solve and your solution seem disconnected to me. What you propose doesn't accomplish your purpose unless you add additional code which is not in your PEP. And it's unclear why adding the capability to do escaping to f-strings and str.format isn't a simpler and better solution. At the very least your PEP should discuss the alternatives such as
f"{!!html}..." # html escapes every string before inserting f"{!!foobar}..." # applies the function 'foobar' to every string before inserting f"...{url!!foobar}" # applies the function 'foobar' to this string value
and any others that have been proposed and weigh the pros and cons.
As I previously noted, this alternative can work for both f-strings and str.format while your proposed t-strings will not.
--- Bruce

Am Mi., 14. Juli 2021 um 19:56 Uhr schrieb Bruce Leban bruce@leban.us:
On Wed, Jul 14, 2021 at 8:50 AM Nick Humrich nick@humrich.us wrote:
[cut]
At the very least your PEP should discuss the alternatives such as
f"{!!html}..." # html escapes every string before inserting f"{!!foobar}..." # applies the function 'foobar' to every string before inserting f"...{url!!foobar}" # applies the function 'foobar' to this string value
and any others that have been proposed and weigh the pros and cons.
These "!!" look like Perl to me. I hope we find a neat and clean syntax.
Regards, Thomas
participants (3)
-
Bruce Leban
-
Nick Humrich
-
Thomas Güttler