Pruss Manifesto - Long numbers

John Roth newsgroups at jhrothjr.com
Mon Nov 10 07:50:20 EST 2003


"Robert Brewer" <fumanchu at amor.org> wrote in message
news:mailman.595.1068464179.702.python-list at python.org...
Georgy Pruss wrote:
> 1) Underscores in numbers. It will help to read long numbers.
> E.g.
>    12_345_678
>    3.14159_26535_89793_23846

Why bother with underscores? There's already a precedent for just
separating them with whitespace; i.e., you can do that with strings:

>>> "banana" "mangos in syrup"
'bananamangos in syrup'

You can do that with strings because strings get long enough
to need to be split over more than one line, and having to
concatinate them explicitly is unnecessarily messy. I frankly
do not see why you would want to put long numbers in well
written programs in the first place.

However, if you do, I'd be much more inclined to support
the idea of writing them the way everyone else does:
with commas and periods. That, at least, has the advantage
of being familiar to people, and it can be supported with
string notation: e"6,882.56" could be implicitly converted
to a float by the compiler.

On balance, I doubt if I'd like to see that, though. It
just doesn't seem useful enough.

John Roth


Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org






More information about the Python-list mailing list