Understanding python functions - Instant Python tutorial

Wildemar Wildenburger wildemar at freakmail.de
Fri Jul 13 12:49:06 EDT 2007


Wildemar Wildenburger wrote:
> x = [1, 2, 3]
> y = [1, 2, 3]
> id(x), id(y)
> x == y
> x is y
>   
Ooops!

Make that:

x = [1, 2, 3]
y = [1, 2, 3]
id(x); id(y)
x == y
x is y

(had to be a semicolon there)



More information about the Python-list mailing list