On 8 March 2012 18:27, Walter Prins <wpr...@gmail.com> wrote: > Just to add, notice that even for lists, > > l = l + [7,8,9] > > produces a new list, while > > l += [7,8,9] > > does not. > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor
I was just thinking about the immutability of things and tried this (which -at least I- find interesting: >>> id(1) 154579120 >>> a = 1 >>> id(a) 154579120 >>> a += 2 >>> id(a) 154579096 >>> id(3) 154579096 >>> a is 3 True >>> Although there is probably no other logical way of doing it - I learnt something new again! _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor