From D

fdu.xiaojf at gmail.com fdu.xiaojf at gmail.com
Tue Jul 31 04:50:00 CEST 2007


Gabriel Genellina wrote:
> En Tue, 24 Jul 2007 11:10:53 -0300, Stargaming <stargaming at gmail.com>  
> escribió:
> 
>> On Tue, 24 Jul 2007 03:19:53 -0700, bearophileHUGS wrote:
>>
>>> There are various things I like about the D language that I think Python
>>> too may enjoy. Here are few bits (mostly syntactical ones):
>>>
>>> 1) (we have discussed part of this in the past) You can put underscores
>>> inside number literals, like 1_000_000, the compiler doesn't enforce the
>>> position of such underscores, so you can also put them like this:
>>> 1_00_000. You can put them in literals of decimals, binary, hex, etc. I
>> Sounds like a good thing to be but the arbitrary positioning doesnt make
>> any sense. Additionally, I'd suggest 10**n in such cases (eg. 10**6).
> 
> Why not? Because in English major numbers are labeled in thousands?  
> (thousand, million, billion...)
> In India, they're grouped by two after the first thousand; in China,  
> they're grouped each 4 digits (that is, there is a single word for "ten  
> thousands" = wan4 = 万, and the next required word is for 10**8 = yi4 = 亿)
> 

  Yes, in China numbers are grouped each 4 digits while it is different in 
other countries, so I think it would be better if we could put arbitrary white 
spaces inside number literals.




More information about the Python-list mailing list