Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ethan Furman Newsgroups: comp.lang.python Subject: Re: Drowning in a teacup? Date: Sat, 02 Apr 2016 16:15:53 -0700 Lines: 26 Message-ID: References: <1459626868.1382635.566734322.250BAE2A@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 3Ij9XF2BF/pooiAiAmE8hwhOWyLXMKu3OK6ald8w0iUA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'assignment': 0.07; 'friday,': 0.07; 'caller.': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'mutable': 0.09; 'python': 0.10; 'value.': 0.15; '"value"': 0.16; '2016': 0.16; 'confusion': 0.16; 'languages)': 0.16; 'proceeding': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'pointed': 0.18; '>>>': 0.20; 'pass': 0.22; 'sat,': 0.23; 'properties': 0.24; 'header:In- Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'order.': 0.27; 'used,': 0.27; 'function': 0.28; '~ethan~': 0.29; 'holds': 0.32; 'statement': 0.32; 'point': 0.33; 'false': 0.35; 'something': 0.35; 'there': 0.36; '(and': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'does': 0.39; 'to:addr:python.org': 0.40; 'called': 0.40; 'show': 0.62; 'here.': 0.62; 'charset:windows-1252': 0.62; 'matter': 0.63; 'batchelder': 0.84; 'utc-4,': 0.84; 'notorious': 0.91; 'have.': 0.93 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: <1459626868.1382635.566734322.250BAE2A@webmail.messagingengine.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:106325 On 04/02/2016 12:54 PM, Random832 wrote: > On Sat, Apr 2, 2016, at 15:28, Ned Batchelder wrote: >> On Friday, April 1, 2016 at 4:27:30 PM UTC-4, Fillmore wrote: >>> notorious pass by reference vs pass by value biting me in the backside >>> here. Proceeding in order. >> >> As others have pointed out, this is false dichotomy. There are other >> possibilities than pass by reference and pass by value. Python (and >> many other languages) use something called pass by object or pass by >> sharing. > > I think that this arises from a confusion as to what a "value" is in > "pass by value". > > The point of it being pass by value is that there is no statement you > can execute in the function that has the effect of an assignment of the > expression that was passed in from the caller. This holds no matter what > kind of object is passed in or what mutable properties it has or does > not have. Also, if "pass-by-value" is being used, even mutation of the passed object will not show up in the caller. -- ~Ethan~