[Python-ideas] Re: Pre PEP: Python Literals (was custom strings before)

2021-06-14 Thread David Mertz
> > >>1. It is too verbose. Typing "conditional_escape(...)" again and >> again is cumbersome. >> >> from django import conditional_espace as esc > f'Hi {esc(name)}' > It's too bad that ␛ U+251B isn't a valid Python identifier. Then we could do it in one character :-) But as I keep

[Python-ideas] Re: Pre PEP: Python Literals (was custom strings before)

2021-06-14 Thread J. Pic
My bad, I had missed nesting template literals support in the PEP, it makes it interesting then! ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org

[Python-ideas] Re: Pre PEP: Python Literals (was custom strings before)

2021-06-14 Thread J. Pic
On Thu, Jun 10, 2021 at 4:07 PM Chris Angelico wrote: > > What's the advantage of htmx? When I want to build a good interactive > web site, my general pattern is a back end with a well-defined API, > and a front end in JavaScript that makes use of this API. That API is > usually going to be

[Python-ideas] Re: Pre PEP: Python Literals (was custom strings before)

2021-06-14 Thread J. Pic
On Thu, Jun 10, 2021 at 8:34 AM Thomas Güttler wrote: > > This solution has two drawbacks: > >1. It is too verbose. Typing "conditional_escape(...)" again and again >is cumbersome. > > from django import conditional_espace as esc f''' Hi {esc(name)} Your messages: {esc(messages)} ''' >