Stephen J. Turnbull wrote:
> But a
> PEP 501 i-string "just works" nicely:
> load_warning = i'Load is too high: {load}'
>     while (theres_work_to_do_matey):
>         if load > max_load:
>             logging.warn(load_warning)
> (This assumes a future version of logging.warn that calls str() on the
> first argument if it is an InterpolationTemplate.)

A "Why this rather than PEP 501's interpolation templates?" is the main thing I 
was looking for in the PEP and I didn't find it.

If the proposal is just a variant on PEP 501 with the syntax changed from 
i"template" to \`template\` and the template type name changed from 
InterpolationTemplate to TemplateLiteral, it doesn't need to be a new PEP, I 
can just explicitly reject those spelling options in PEP 501. (The reasons for 
that PEP's deferral unfortunately still hold, though - eager rendering, runtime 
value interpolation, and dedicated templating libraries together cover enough 
cases that the motivation for introducing the semantic complexity of yet 
another templating option gets weakened dramatically).

If the differences between the proposals run deeper than that, then the 
proposed new PEP needs to spell them out.
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/XSGJO3VX3HBSGESRUFDTMI2LTJFNRY66/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to