[Python-ideas] 1_000_000

Matt Chaput matt at whoosh.ca
Fri May 6 23:36:47 CEST 2011


On 06/05/2011 5:26 PM, Kirubakaran wrote:
> (fixed typo)
> How about range(10**6) ?

Both 1e6 (if it worked in the example) and 10**6 both require a bit of 
work (at least for my non-mathematician brain) to decode as "1 million", 
whereas with 1_000_000 you're not so much counting the zeros in your 
head as counting the *groups* of zeros visually. For me it's much more 
readable at a glance.

Also, obviously the 10**6 trick doesn't work so well if the example is:

   for i in range(47_284_345):
     pass

Matt



More information about the Python-ideas mailing list