Comparison between Python and "Ruby"

Ivan Van Laningham ivanlan at callware.com
Fri Oct 29 18:13:04 EDT 1999


Hi All--

Martijn Faassen wrote:
> 
> Ian Clarke <I.Clarke at strs.co.uk> wrote:
> [quoted from the Ruby documention]
> > Problems with Python are:
> 

[bobbitt]

> > * No way to automatically convert between long integer and small
> > integer.
> 
> I'll leave this to someone else. Is this a problem? A feature?
> 

I'll only address this issue, because it affects my Mayan code.

To me, it's a problem.  It's a great big pain to have to be constantly
on the lookout for overflows and to remove 'L's from string
representations of longs.  Sure, I could work completely with longs, but
a great deal of Mayan mathematics is done with small constant integers
(7, 13, 9, 260, 365, 819, 18980 and so on).  I'm reluctant to convert
and lose the speed advantage for numbers in the range -MAXINT to
MAXINT.  Someone else complained about transparent conversions being a
bad thing (tm), but for me they would be a *big* win.  My code would
become much clearer.

At the same time, I can certainly see that others wouldn't like the
behavior that I would; not everyone is working with numbers and dates
large enough to take up significant amounts of memory (beside which mere
trillions of years pale).  However, built in support for Very Large
Numbers is one of the reasons I *love* Python.

<one-person's-gigayear-is-another's-nanosecond>-ly y'rs,
Ivan
----------------------------------------------
Ivan Van Laningham
Callware Technologies, Inc.
ivanlan at callware.com
ivanlan at home.com
http://www.pauahtun.org
See also: 
http://www.foretec.com/python/workshops/1998-11/proceedings.html
Army Signal Corps:  Cu Chi, Class of '70
----------------------------------------------




More information about the Python-list mailing list