Conditional operator in Python?

Ben Wolfson wolfson at midway.uchicago.edu
Wed Apr 4 16:10:15 EDT 2001


In article <slrn9cm8b4.uhi.neelk at alum.mit.edu>,
Neelakantan Krishnaswami <neelk at alum.mit.edu> wrote:
>On Wed, 4 Apr 2001 09:33:07 +0200, Alex Martelli <aleaxit at yahoo.com> wrote:
>>
>> I suspect spaces (or underscores?) within _numeric literals_ might
>> prove more popular -- I'd LOVE to be able to write, e.g.:
>>
>>    a = 1 000 000 000
>>
>> to make the number "one billion" more legible -- but maybe it's not
>> as good an idea as it seems at first glance: if the number of digits
>> between separating spaces was not checked, it might be misleading;
>> if it WAS checked, then I'm not sure that "three by three" is OK in
>> all locales (but maybe non-US locales need not be supported here,
>> just as they aren't, for example, for decimal-point).
>
>I agree about commans, but I don't like using spaces; Ada's solution
>of permitting underscores '_' inside numeric literals is a nice
>compromise between the limitations of ASCII and the limitations of
>human readers.
>
>So the above might be written
>
>  a = 1_000_000_000
>
>which is fairly readable and culture non-specific. (Though using
>commas as decimal-points is even more brain-damaged than using
>periods, which just shocks me -- what's that about fine European
>design again? ;)

Vyper, if it still exists, allows/allowed this.



-- 
Barnabas T. Rumjuggler
The women come and go,
Speaking of the Regis Philbin Show
 -- Joe Frank



More information about the Python-list mailing list