[Python-ideas] Re: Config file template motivation for PEP 463 or an update to format string spec

2022-04-02 Thread Kale Kundert
Have you considered using a templating library like Jinja2 or Mako?  That's my first thought whenever I want something that's too complicated for `str.format()`.  In addition to handling default values, these libraries would also give you the ability to encode some simple logic in your files, which

[Python-ideas] Custom literals, a la C++

2022-04-02 Thread Stephen J. Turnbull
Will Bradley writes: > C++ has custom literal syntax > . I couldn't find > a PEP on the subject— has this been considered and rejected, or is there a > reason it's unpopular? I'm pretty sure there is no PEP on that specifically, and I c

[Python-ideas] Re: Custom literals, a la C++

2022-04-02 Thread Steven D'Aprano
On Sun, Apr 03, 2022 at 01:09:00PM +0900, Stephen J. Turnbull wrote: > There was a proposal to provide literal syntax for physical units like > meters, kilograms, and seconds, along the the SI magnitude prefixes. > I think that got to the "proto-PEP" stage, but it got a lot of weak > opposition fo