2017-12-21 22:06 GMT+03:00 John Ladasky <john_lada...@sbcglobal.net>:
> On Thursday, December 21, 2017 at 7:37:39 AM UTC-8, MRAB wrote: > > > Python never makes a copy unless you ask it to. > > > > What x1=X does is make the name x1 refer to the same object that X > > refers to. No copying. > > Well, except with very simple, mutable data types like scalars... compare > this: > No copy means no copy, it is the rule! What you see is really new binding operation under the hood. 'x=1; x += 1', means calculate x+1 and bind it to the same name. Compare it to this example: >>> tpl = ((1,2),(3,4)) >>> tpl += ((1,2),) >>> tpl ((1, 2), (3, 4), (1, 2)) No copy, new binding to the same name :) With kind regards, -gdg -- https://mail.python.org/mailman/listinfo/python-list