On Aug 31 2016, Guido van Rossum <guido-+zn9apsxkcednm+yrof...@public.gmane.org> wrote: > On Wed, Aug 31, 2016 at 5:21 AM, Nick Coghlan > <ncoghlan-re5jqeeqqe8avxtiumw...@public.gmane.org> wrote: >> On 31 August 2016 at 17:07, Chris Angelico >> <rosuav-re5jqeeqqe8avxtiumw...@public.gmane.org> wrote: >>> On Wed, Aug 31, 2016 at 2:08 PM, Ken Kundert >>> <python-ideas-jl/pdlm0qtzz1n+oakn...@public.gmane.org> wrote: >>>> > What's the mnemonic here? Why "r" for scale factor? >>>> >>>> My thinking was that r stands for real like f stands for float. >>>> With the base 2 scale factors, b stands for binary. >>> >>> "Real" has historically often been a synonym for "float", and it >>> doesn't really say that it'll be shown in engineering notation. But >>> then, we currently have format codes 'e', 'f', and 'g', and I don't >>> think there's much logic there beyond "exponential", "floating-point", >>> and... "general format"? I think that's a back-formation, frankly, and >>> 'g' was used simply because it comes nicely after 'e' and 'f'. (C's >>> decision, not Python's, fwiw.) I'll stick with 'r' for now, but it >>> could just as easily become 'h' to avoid confusion with %r for repr. >> >> "h" would be a decent choice - it's not only a continuation of the >> e/f/g pattern, it's also very commonly used as a command line flag for >> "human-readable output" in system utilities that print numbers. > > I like it. So after all the drama we're just talking about adding an > 'h' format code that's like 'g' but uses SI scale factors instead of > exponents. I guess we need to debate what it should do if the value is > way out of range of the SI scale system -- what's it going to do when > I pass it 1e50? I propose that it should fall back to 'g' style then, > but use "engineering" style where exponents are always a multiple of > 3.)
There's also the important nitpick if 32e7 is best rendered as 320 M or 0.32 G. There's valid applications for both. Best, -Nikolaus -- GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F »Time flies like an arrow, fruit flies like a Banana.« _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/