Am 21.04.2012 05:25, schrieb Rotwang: > On 21/04/2012 01:01, Roy Smith wrote: >> In article<877gxajit0....@dpt-info.u-strasbg.fr>, >> Alain Ketterlin<al...@dpt-info.u-strasbg.fr> wrote: >> >>> Tuples are immutable, while lists are not. >> >> If you really want to have fun, consider this classic paradox: >> >>>>> [] is [] >> False >>>>> id([]) == id([]) >> True > > Huh. This is not what I would have expected. What gives?
This happens only because the first [] gets destroyed after evaluation of id([]). The second [] then by accident gets the same id as the first one had. >>> a = [] >>> b = [] >>> id(a) == id(b) False Greetings -- http://mail.python.org/mailman/listinfo/python-list