Remix.run Logo
wodenokoto 8 months ago

I've been toying with the idea of having arbitrary string types, like

    sql"SELECT FROM ..."
or

    re"\d\d[abc]"
that the development environment could highlight properly, that would ... I don't know. In the end t and f string don't do anything that a t() and f() function couldn't have done, except they are nice. So it would be nice to have more.
zahlman 8 months ago | parent [-]

IIRC, previous versions of the PEP wanted things to work this way. You might also be interested in the "syntactic macros" PEP (https://peps.python.org/pep-0638/).