Result of ``a is b''

George Yoshida ml at dynkin.com
Tue Mar 16 11:01:07 EST 2004


Delaney, Timothy C (Timothy) wrote:
> In CPython for example, small integers will be reused (-10..99 IIRC) and identical string constants will be reused.

Integers between -5 and 99 are reused.

Here is an excerpt from Objects/intobject.c.

#ifndef NSMALLPOSINTS
#define NSMALLPOSINTS		100
#endif
#ifndef NSMALLNEGINTS
#define NSMALLNEGINTS		5
#endif

-- George



More information about the Python-list mailing list