
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:
By immediately calling format on your t-strings in your examples you obfuscate what this is doing. Here's a better example:
And what about this:
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

On Wed, Jul 14, 2021 at 8:50 AM Nick Humrich <nick@humrich.us> wrote:
By immediately calling format on your t-strings in your examples you obfuscate what this is doing. Here's a better example:
And what about this:
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
participants (3)
-
Bruce Leban
-
Nick Humrich
-
Thomas Güttler