echeverria at interactiva.cl
Sun Mar 19 13:14:29 CET 2000
> Could someone tell me why the value returned by id(), which is just an
> int, says type(), is acting a little fruity for me? If a and b hold the
> same integer, shouldn't they have the same value for id()? And why do
> >>> a = b # and
> >>> a = b + 0
> have two different effects?
Id() return something like the current address of an object.
a = b means that a and b are the same objects, if then you write
b = 100
print a, will print 100
a = b + 0, then the operation "+" return a new object changing the
name binding to "a"
More information about the Python-list