Integer division (was: Case-sensitivity... (was: Damnation!))

François Pinard pinard at iro.umontreal.ca
Sun May 21 22:37:09 EDT 2000


Moshe Zadka <moshez at math.huji.ac.il> écrit:

> On 21 May 2000, [ISO-8859-1] François Pinard wrote:

> > No doubt that I would not like having to revise existing code!  But also,
> > as the current `i / j' gives access to useful hardware instruction, a new
> > `int(i/j)' might incur unwelcome overhead for something that once was faster.

> Hardware instruction?  Hardware instruction?  Francois, you need a
> theraputic session with gdb on Python. Try to single-step

> python -c '1/2'

> And see that the hardware instruction is lost in a sea of function calls
> and jumps all over the place.

You are surely right, and are exposing my naivety :-).  But do not deprive
me of all my dreams.  Let's not give so soon into the thinking that Python
might never be cleverly compilable.  Who knows if things would not evolve
in a direction that might allow such things, one of these days.

Scheme is astonishingly compilable for a dynamically typed language (Python
is another dynamically typed language).  If Scheme was to influence Python
design a bit, this might be an aspect to analyse and ponder.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard






More information about the Python-list mailing list