[issue7910] immutability w/r to tuple.__add__

2010-02-11 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> invalid ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue7910] immutability w/r to tuple.__add__

2010-02-11 Thread Matthew Russell
Matthew Russell added the comment: Yes, the output is fishy indeed my bad (paste error). Tim: I hadn't thought for long enough or thought to check with the id builtin - nice catch. -- status: open -> closed ___ Python tracker

[issue7910] immutability w/r to tuple.__add__

2010-02-11 Thread Tim Golden
Tim Golden added the comment: Just think about it for a minute: t = (1, 2) print id (t), t t += (1, 2, 3) print id (t), t Not mutating, merely creating a new new object and giving it the same name -- nosy: +tim.golden ___ Python tracker

[issue7910] immutability w/r to tuple.__add__

2010-02-11 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: Your output looks fishy. Anyway, the behavior of += isn't a bug: >>> a = b = (1, 2) >>> a += (1, 2, 3) >>> a (1, 2, 1, 2, 3) >>> a is b False >>> It's confusing, to be sure, but no mutation is going on. += is only in-place if applied to something that

[issue7910] immutability w/r to tuple.__add__

2010-02-11 Thread Matthew Russell
New submission from Matthew Russell : Tuples, as we know are designed to immutable. Hence I'm questioning if the following behavior is considered a defect: >>> t = (1, 2) >>> t += (1, 2, 3) >>> t (1, 2, 3) ? -- components: Interpreter Core messages: 99219 nosy: mattrussell severity: n