<div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">[Guido]</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Gah! You are overthinking it. This idea is only worth it if it's dead simple, and the version that Eric posted to start this thread, where !d uses the repr() of the expression, is the only one simple enough to bother implementing.</div></div></blockquote><div><br>In that case, I have no real use for it, for reasons already explained (I rarely want the repr, and already have lots of code that tediously repeats the<br><br>    EXPR {EXPR:FMT}<br><br>pattern inside f-strings).  Even for displaying integers, where you might _assume_ I'd be happy with the repr, I'm often not:<br><br><div>    print(f"nballs {nballs:,} into nbins {nbins:,}")<br><br>is one I just happened to write today.  Without comma formatting, the output is much harder to read.<br><br>Note that transforming<br><br>   {EXPR!d:FMT}<br><br>into<br><br>   EXPR={repr(EXPR):FMT}<br><br>is actually slightly more involved than transforming it into<br><br>   EXPR={EXPR:FMT}<br><br>so I don't buy the argument that the original idea is simpler.  More magical and less useful, yes ;-)</div><div><br></div></div></div></div></div>