Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Antoon Pardon Newsgroups: comp.lang.python Subject: Re: I'm wrong or Will we fix the ducks limp? Date: Thu, 9 Jun 2016 13:19:18 +0200 Lines: 31 Message-ID: References: <1465148542.2670061.628500777.62F1EFE1@webmail.messagingengine.com> <5754f36b$0$1619$c3e8da3$5496439d@news.astraweb.com> <1465186088.3554819.628831041.19D0DC8D@webmail.messagingengine.com> <575599f4$0$1595$c3e8da3$5496439d@news.astraweb.com> <57569f6a$0$11124$c3e8da3@news.astraweb.com> <5756BED8.2000304@rece.vub.ac.be> <1465313620.1380508.630546953.7F7E755D@webmail.messagingengine.com> <5757CF15.4010002@rece.vub.ac.be> <5757dbaf$0$1615$c3e8da3$5496439d@news.astraweb.com> <5757E840.80805@rece.vub.ac.be> <57591c7f$0$1522$c3e8da3$5496439d@news.astraweb.com> <57593AF7.3080505@rece.vub.ac.be> <575950B6.3080807@rece.vub.ac.be> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de H9hvknedxTKfoy7sc4AugADuLsV6esuSeMU2xl/z3n+Q== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.027 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'received:134': 0.05; 'assignment': 0.07; 'attributes': 0.07; 'defined.': 0.09; 'semantics': 0.09; 'python.': 0.11; 'assignment.': 0.16; 'attributes.': 0.16; "can't.": 0.16; 'received:ac.be': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'later': 0.16; 'variable': 0.18; 'language': 0.19; '>>>': 0.20; 'pascal': 0.22; 'struct': 0.22; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'example': 0.26; 'record': 0.29; 'received:be': 0.30; 'generally': 0.32; 'steven': 0.33; 'languages': 0.34; 'replace': 0.35; 'something': 0.35; 'to:addr :python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'subject:the': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'your': 0.60; 'you.': 0.64; 'other.': 0.64; 'else.': 0.66; 'buying': 0.67; 'car': 0.72; 'confusing': 0.84; "d'aprano:": 0.84; 'demonstrates': 0.84; 'entry,': 0.84; 'pardon': 0.84; 'schreef': 0.84; 'same,': 0.91 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArIIAHYeUleGuA9G/2dsb2JhbABehFsBvRCGEgKCAAEBAQEBAWaEbQEBBCNVEQsYAgIFFgsCAgkDAgECAUUTCAKIK7FNjT6DWwEBCAIlgQGFJoRNhQyCNYJZAQSYRYFXjE2JM4Vpj1JUg3CKfgEBAQ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <575950B6.3080807@rece.vub.ac.be> X-Mailman-Original-References: <1465148542.2670061.628500777.62F1EFE1@webmail.messagingengine.com> <5754f36b$0$1619$c3e8da3$5496439d@news.astraweb.com> <1465186088.3554819.628831041.19D0DC8D@webmail.messagingengine.com> <575599f4$0$1595$c3e8da3$5496439d@news.astraweb.com> <57569f6a$0$11124$c3e8da3@news.astraweb.com> <5756BED8.2000304@rece.vub.ac.be> <1465313620.1380508.630546953.7F7E755D@webmail.messagingengine.com> <5757CF15.4010002@rece.vub.ac.be> <5757dbaf$0$1615$c3e8da3$5496439d@news.astraweb.com> <5757E840.80805@rece.vub.ac.be> <57591c7f$0$1522$c3e8da3$5496439d@news.astraweb.com> <57593AF7.3080505@rece.vub.ac.be> Xref: csiph.com comp.lang.python:109731 Op 09-06-16 om 12:53 schreef BartC: > On 09/06/2016 10:46, Antoon Pardon wrote: >> Op 09-06-16 om 09:36 schreef Steven D'Aprano: > >>> Your example demonstrates object mutation, not assignment. >> >> Generally assignment and mutation don't contradict each other. >> So IMO the cause is the same, a mutation. In some languages you >> can mutate your variable through an assignment and in others you >> can't. > > I think this is what is confusing you. > > Mutation is like repairing or customising my car. > > Full assignment is like buying a new car. I think you are confused. Full assignment of C struct or Pascal record is the same as mutating all individual attributes. You don't get a new record/instance as in Python. You replace the value of the attributes with something else. As far a language semantics are concerned, you get the (new) car at scope entry, all assigments later are mutations. You may think of assignment as like buying a new car, that is not how the semantics of languages like pascal and C are defined.