[Guido] > 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. >
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 EXPR {EXPR:FMT} pattern inside f-strings). Even for displaying integers, where you might _assume_ I'd be happy with the repr, I'm often not: print(f"nballs {nballs:,} into nbins {nbins:,}") is one I just happened to write today. Without comma formatting, the output is much harder to read. 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 ;-)
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/