[Tim]
>
> > Note that transforming
> >
> >     {EXPR!d:FMT}
> >
> > into
> >
> >     EXPR={repr(EXPR):FMT}
> >
> > is actually slightly more involved than transforming it into
> >
> >     EXPR={EXPR:FMT}
> >
> > so I don't buy the argument that the original idea is simpler.  More
> > magical and less useful, yes ;-)
>

[Eric V. Smith]

> Actually, my proposal is to apply FMT to the entire result of

EXPR={repr(EXPR)}, not just the repr(EXPR) part. I'm not sure either is
> particularly useful.
>

So the actual transformation is from

    {EXPR!d:FMT}

to

    {"EXPR=" + repr(EXPR):FMT}

I expect I'll barely use "!d" at all if the format doesn't apply to the
result of EXPR, so I have no non-contrived ;-) opinion about that.

BTW, I checked, and I've never used !r, !s, or !a.  So the idea that the
format could apply to a string - when EXPR itself doesn't evaluate to a
string - is simply foreign to me.  I suppose it's natural to people who do
use ![rsa] all the time - if such people exist ;-)
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to