python assignment
Peter Hansen
peter at engcorp.com
Wed Jul 23 10:06:06 EDT 2003
Grant Edwards wrote:
>
> In article <slrnbhrqtj.9jf.bignose-hates-spam at iris.polar.local>, Ben Finney wrote:
>
> >> What I need is an exact and unambiguous algorithm for determining when
> >> an assignment will change the id of the variable
> >
> > As I understand it, this is specific to the implementation of each type.
> > The only sensible way to code is as if the identity of an object, on
> > assignment, were completely unpredictable.
> >
> > The examples you gave showed that integers share identity with other
> > integers of the same value, while floats do not.
>
> I believe that's only true for small integers, isn't it?
Google finds "LOADI - a fast load instruction for small positive integers
(those referenced by the small_ints array in intobject.c)" and checking
that file is left as an exercise to the reader. I'm going to blindly
assume this is directly related to the issue in question... ;-)
-Peter
More information about the Python-list
mailing list