counting references to an instance

Terry Reedy tjreedy at udel.edu
Fri Feb 6 13:20:57 EST 2004


"Michael Hudson" <mwh at python.net> wrote in message
news:m34qu45unv.fsf at pc150.maths.bris.ac.uk...
> "Delaney, Timothy C (Timothy)" <tdelaney at avaya.com> writes:
>
> > > From: Gerrit
> > > IIRC, Python keeps references of all small integers,
> > > apparantly all smaller than 100.

This should have said "CPython ..." since this is implementation-specific
speedup and not part of the language spec.

> > Actually -1 through to 99.

This was true for CPython 1.4 when I tested.

> Um, this is rank pedantry, but it's -5 to 99...

in the current version (and perhaps since some years)

> >>> (0 - 5) is -5
> True
> >>> (0 - 6) is -6
> False

Message: undocumented implementation features can silently change and
should not be depended on (or expoused) without current verification ;-).

Terry J. Reedy








More information about the Python-list mailing list