Tagged templates in JavaScript look interesting[1] foo`...${bar} ...`
Where `foo` is an arbitrary method provided by the user. But somehow I think general purpose string interpolation (PEP501) is enough. At least my use-case: Get something like this format_html() but with the power of f-strings, PEP501 would be enough. What do you think? Regards, Thomas [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates Am Fr., 4. Juni 2021 um 23:39 Uhr schrieb Guido van Rossum <gu...@python.org >: > On Fri, Jun 4, 2021 at 3:08 PM Thomas Güttler <i...@thomas-guettler.de> > 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 finish the >> first. >> >> Why not reject PEP-501 officially? Maybe with a reason. Then we know >> what's wrong with it. >> > > You'd have to ask its author. Most likely he'll just withdraw the PEP > completely without telling you anything more. > > In short, I don't think you're going to get much out of trying to get > anyone to say anything "official" about PEP 501. > > If you really want to know more, you could probably dig up the discussions > around that PEP and learn from that. > > >> After that is done, we can think about a new start. >> > > There's no need to wait for that. > > >> What do you think? >> >> >> >> >> >>> 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. >>> >>> >> I personally really would like to avoid the dollar sign which gets used >> in JS template literals. >> > > Well of course. The Python equivalent would use the exact same > interpolation syntax as f-strings (and before it, str.format()). > > -- > --Guido van Rossum (python.org/~guido) > *Pronouns: he/him **(why is my pronoun here?)* > <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> >
_______________________________________________ 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/YSY4HOGJMFCV3CPYI2PEDSPXXFHUL2PZ/ Code of Conduct: http://python.org/psf/codeofconduct/