On Tue, Jul 6, 2021 at 6:10 AM Jim Baker <jim.ba...@python.org> wrote:
>
> On Mon, Jul 5, 2021, 12:56 PM Barry Scott <ba...@barrys-emacs.org> wrote:
>>
>>
>>
>> On 5 Jul 2021, at 08:07, Thomas Güttler <i...@thomas-guettler.de> wrote:
>>
>> This means backticks, but without the dollar sign.
>>
>>
>> In bash the backtick was so often a problem that $(cmd) was added.
>>
>> Having removes the grit-on-Tim's-screen backtick in python 3 I would
>> not like to see it return with its issue of being confused with single-quote.
>
>
> One mitigation is that the backtick should always require a tag as a prefix. 
> So seeing something like
>
> elem = html`<p>Some item: {value}</p>`
>
> is hopefully fairly obvious what's going on - it's not just going to be mixed 
> up with a single quote. Uses like log(f`foo`) should be hopefully 
> discouraged, in the same way that we don't use l (that's the lower-case 
> letter L if you're not reading this email with the numeric codepoints) as a 
> variable, but we are happy enough to write something like limit = 42 - it's 
> clear in the context.
>

Question: what's the advantage of this magic syntax over something much simpler:

elem = html(i'<p>Some item: {value}</p>')

That avoids the backtick problem because it actually IS an apostrophe.
Or a double quote. Or triple quotes, whatever you want to use. It's
the exact format already used for other special string literal types,
including f-strings.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/UVKP74PGCWTZSFBDMFMIIWKXMU7PCJ2R/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to