[Python-ideas] Re: Custom-Strings: Combine f-strings and condtional_escape()

2021-06-04 Thread Guido van Rossum
On Fri, Jun 4, 2021 at 3:08 PM Thomas Güttler wrote: > > > Am Fr., 4. Juni 2021 um 19:20 Uhr schrieb Guido van Rossum < > gu...@python.org>: > >> PEP 501 is unlikely to be accepted *as is*. But it’s still a good >> starting point. >> >> > OK, before starting a new project, it maybe makes sense to

[Python-ideas] Re: Custom-Strings: Combine f-strings and condtional_escape()

2021-06-04 Thread Thomas Güttler
Am Fr., 4. Juni 2021 um 19:20 Uhr schrieb Guido van Rossum : > PEP 501 is unlikely to be accepted *as is*. But it’s still a good starting > point. > > OK, before starting a new project, it maybe makes sense to finish the first. Why not reject PEP-501 officially? Maybe with a reason. Then we know

[Python-ideas] Re: Custom-Strings: Combine f-strings and condtional_escape()

2021-06-04 Thread Guido van Rossum
PEP 501 is unlikely to be accepted *as is*. But it’s still a good starting point. Personally I would look for inspiration towards JavaScript template literals ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals), combined with f-string-like interpolation. On Fri,

[Python-ideas] Re: Custom-Strings: Combine f-strings and condtional_escape()

2021-06-04 Thread Thomas Güttler
Am Fr., 4. Juni 2021 um 15:42 Uhr schrieb Richard Damon < rich...@damon-family.org>: > I think one fundamental problem is that you can’t detect programmatically > if a string needs to be escaped or not. > > For instance, the sequence & might be an already escaped & or it might > be the text to tel

[Python-ideas] Re: Custom-Strings: Combine f-strings and condtional_escape()

2021-06-04 Thread Thomas Güttler
Thank you for this hint. PEP-501 looks very good. But how to get this dream come true? Regards, Thomas Am Fr., 4. Juni 2021 um 14:39 Uhr schrieb Chris Angelico : > On Fri, Jun 4, 2021 at 10:02 PM Thomas Güttler > wrote: > > > > Hi, > > > > I have a crazy idea how to extend Python for web de

[Python-ideas] Re: Custom-Strings: Combine f-strings and condtional_escape()

2021-06-04 Thread Richard Damon
I think one fundamental problem is that you can’t detect programmatically if a string needs to be escaped or not. For instance, the sequence & might be an already escaped & or it might be the text to tell you how to escape an ampersand and needs to be converted to & Promoting sloppy coding

[Python-ideas] Re: Custom-Strings: Combine f-strings and condtional_escape()

2021-06-04 Thread Matt del Valle
Interpolation templates were recently brought up here ( https://mail.python.org/archives/list/python-ideas@python.org/thread/5AW73ICBD4CVCRUNISRNAERPPF2KSOGZ/), and Guido mentioned that in his opinion the SC would be unlikely to reconsider PEP 501 in its current state. I trust that he has a much be

[Python-ideas] Re: Custom-Strings: Combine f-strings and condtional_escape()

2021-06-04 Thread Chris Angelico
On Fri, Jun 4, 2021 at 10:02 PM Thomas Güttler wrote: > > Hi, > > I have a crazy idea how to extend Python for web development. > > What do you think? What are the next steps? > > [chomp details] Something like this - but more generic - has been proposed already: https://www.python.org/dev/peps/

[Python-ideas] Custom-Strings: Combine f-strings and condtional_escape()

2021-06-04 Thread Thomas Güttler
Hi, I have a crazy idea how to extend Python for web development. What do you think? What are the next steps? Original: https://github.com/guettli/python-custom-strings Python Custom Strings Python Custom Strings want to combine two great things: - Python's f-strings