[Tutor] Identity operator (basic types)

Cecilia Alm ebbaalm at uiuc.edu
Sat Feb 10 06:34:56 CET 2007

Why does the identity operator return "True" in the below cases, that is
when assigning  the same value to basic variable types (float, integer,
string, bool..)? Are these rcopied by reference (shallow)? If so why?

>>> i = 10
>>> j = 10
>>> i is j

>>> a = 10
>>> b = a
>>> a is b

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070209/9199bc55/attachment.htm 

More information about the Tutor mailing list