[Python-ideas] Briefer string format

Andrew Barnert abarnert at yahoo.com
Mon Jul 20 07:23:02 CEST 2015


On Jul 19, 2015, at 21:42, Mike Miller <python-ideas at mgmiller.net> wrote:
> 
> (Might a further optimization in C be possible to skip the function call, but
> basically work like this?  No locals/globals()?)

Why do you keep bringing up optimization? Do you actually have code where the call to str.format or str.format or str.__mod__ or locals is actually a relevant cost? It seems to me that whenever that call is too slow to bear, calling __str__ or __format__ on all of the substitutes variables must be far more of a problem, so your optimized version would still be useless.


More information about the Python-ideas mailing list