On Jan 31, 2018 8:12 PM, "Nick Coghlan" <ncogh...@gmail.com> wrote:
On 1 February 2018 at 08:14, Eric V. Smith <e...@trueblade.com> wrote: >>> print(f"In European format x is {x:,.2f}, in Indian format it is {x:,2,3.2f}") > This just seems too complicated to me, and is overgeneralizing. How many of > these different formats would ever really be used? Can you really expect > someone to remember what that means by looking at it? That's even more arbitrary and hard to interpret than listing out the grouping spec, though. I suggested a single character, although my thought of backtick was different from Eric's of semicolon. Neither of them would be obvious, but rather "something to look up the first few times." There is a lot in the format mini-language that is "have to look up" though. A single character South Asian number delimiter style wouldn't be different from a lot of features of that DSL. Albeit, most of it seems intuitive after you've used it a while... The symbols are somewhat iconic. I think if we only cared about decimal digit groups (which is all I initially thought of), Nick's would be excessive generalization. However, when you think of also grouping hex, octal, and binary, there genuinely are several conventions and different useful presentations. So overall I do like Nick's approach better than my initial suggestion or Eric's one that is similar to mine.
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/