Re: tuple of ids of integers or lists

2013-03-17 Thread Chris Angelico
On Mon, Mar 18, 2013 at 7:23 AM, wrote: > OK. Now I understand it. > > I was confused because when two list are created in two different lines, > Python gives them different ids, but when the two lists are created in the > same line (in a tuple) Python gives them the same id. It doesn't really

Re: tuple of ids of integers or lists

2013-03-17 Thread bartolome . sintes
OK. Now I understand it. I was confused because when two list are created in two different lines, Python gives them different ids, but when the two lists are created in the same line (in a tuple) Python gives them the same id. It doesn't really matter as these lists are just created and destro

Re: tuple of ids of integers or lists

2013-03-17 Thread Roy Smith
In article <8e66719c-5e90-4776-bba9-a11c29fba...@googlegroups.com>, bartolome.sin...@gmail.com wrote: > In Python 3.3 for Windows, every list gets a different id when it is created: > > >>> id([3]) > 46555784 > >>> id([3]) > 47920192 > >>> id([4]) > 46532048 > > But if I write a tuple asking fo

tuple of ids of integers or lists

2013-03-17 Thread bartolome . sintes
In Python 3.3 for Windows, every list gets a different id when it is created: >>> id([3]) 46555784 >>> id([3]) 47920192 >>> id([4]) 46532048 But if I write a tuple asking for the ids of two lists, each list seems to get the same id: >>> id([3]), id([4]) (43079000, 43079000) I was expecting a t