On Mon, Jun 14, 2021 at 8:58 AM Jim Baker <jim.ba...@python.org> wrote:
>
> * Logging strings which don't have to format their expressions - so similar 
> to current logging when not using f-strings, but with the easy interface of 
> f-strings, including desired formatting of expressions in simple logger 
> scenarios
>

The only benefit would be the string formatting; the expressions have
to be evaluated still. Is that worth it?

> * Internationalization of strings

Of dubious value, since the strings have to be externalized. MAYBE
useful but would need something complicated where the original form is
a code construct, but the i18n library can get the source code and use
it as a lookup key to find the translated form. Seems pretty messy.

> * SQL queries with sanitization of expressions (to avoid "Bobby Tables" 
> injection)

You shouldn't be sanitizing your expressions, you should be
parameterizing your query. That doesn't mean this is of *no* value,
but it does make it look a lot less like a string literal.

> * Object literals - something like D"10.2" instead of the somewhat longer 
> D("10.2"), assuming for the latter `from decimal import Decimal as D` (this 
> is a pretty weak argument on the face of it, but I can see the possibility of 
> being more restrictive in the use of monkey patching namespaces with such 
> literals to avoid unnecessary function call overhead...)
>

Of value only if it gets an extremely compact syntax. Other use-cases
could be better served by a syntax like html(i".....") but this one
only works if it's that kind of notation.

> * Code (or AST) construction, following the quasiquote idea from Lisp

Not sure how this would work, but given that I don't use Lisp enough
to be familiar with the use-cases, I won't argue this one.

> * Latex and other minilanguages (is Latex properly a minilanguage? ;) )

Explain?


I'd love to have some sort of generic interpolation construct, but the
use-cases all seem really weak...

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/2PUNL7NWPSXWQYD7M76KCUEKKDMUSRH3/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to