Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!bcyclone04.am1.xlned.com!bcyclone04.am1.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'value,': 0.03; 'subject:Python': 0.05; 'assignment': 0.07; 'assigning': 0.09; 'mutable': 0.09; 'cc:addr:python-list': 0.10; 'python': 0.11; 'itself.': 0.11; 'wed,': 0.15; 'thu,': 0.15; 'box".': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.16; 'passes': 0.18; 'changes': 0.20; 'skip:" 30': 0.20; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'pass': 0.22; 'am,': 0.23; '2015': 0.23; 'passing': 0.23; 'header:In-Reply- To:1': 0.24; 'message-id:@mail.gmail.com': 0.28; "doesn't": 0.28; "i'm": 0.29; 'argue': 0.29; 'function': 0.30; '-0700': 0.33; 'option.': 0.33; 'traditional': 0.33; 'changing': 0.34; 'definition': 0.34; 'subject:?': 0.34; 'received:google.com': 0.34; 'wrong': 0.35; 'but': 0.36; 'subject:: ': 0.37; 'rather': 0.38; 'means': 0.39; 'easily': 0.39; 'some': 0.40; "you've": 0.61; 'waiting': 0.63; 'within': 0.64; 'email addr:gmail.com': 0.64; 'box,': 0.67; 'chrisa': 0.84; 'proves': 0.84; 'viable': 0.84; 'to:none': 0.90; 'dennis': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=eh7ryqAFE8gCrZxAn7g5+3WOgltt3C/w7AKr4l6QE9s=; b=het0AMNH9Vc7+CDigbZwkdEMFRuhs+HV7OCnwzHmird/43M7uRQmHmDhTQfR08b7vo UOEZ700EkjrhNdCfHnwVCgdsEaHqL8Hb3OL+cK+FtcAB1oeRKLQMmKDd+AIIMQfi30bB XU1h8cWYQ37XAZIa9s0cBl6vrd8v3iDaT310iU/CSmLIDkBdQu4KlwLAkbCfQfevadCH tVfKLNFkcfwh1r0zmG4vkraGfZohveZPkBJTam3d3/krcw7XApP9p71XWxH5nlNOTvN0 gRPHvcqt+owmvs/zBEG2LfeTsUkSmhdtkX0GCapDe+RIFQPNM252ySVZx6l6287AUdrZ 7O/A== MIME-Version: 1.0 X-Received: by 10.50.141.164 with SMTP id rp4mr31173555igb.2.1433382736657; Wed, 03 Jun 2015 18:52:16 -0700 (PDT) In-Reply-To: <69avma9djtmpmmncceh7euhv2b2ni5itd9@4ax.com> References: <3bbe49da-e989-4a8c-a8a9-75d3a786f508@googlegroups.com> <69avma9djtmpmmncceh7euhv2b2ni5itd9@4ax.com> Date: Thu, 4 Jun 2015 11:52:16 +1000 Subject: Re: Can Python function return multiple data? From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433382739 news.xs4all.nl 2882 [2001:888:2000:d::a6]:57810 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 4571 X-Received-Body-CRC: 538276179 Xref: csiph.com comp.lang.python:92018 On Thu, Jun 4, 2015 at 11:30 AM, Dennis Lee Bieber wrote: > On Wed, 3 Jun 2015 15:28:56 -0700 (PDT), sohcahtoa82@gmail.com declaimed > the following: > >> >>People actually argue that Python passes by value? This is easily proven wrong by passing a mutable object to a function and changing it within the function. > > Which only proves you passed a mutable object... Mutating the object > means you've performed some operation that "goes inside the box". > > Try assigning a new object to it rather than mutating it... IE; don't > go inside the box, but try to change the box itself. Doesn't carry out -- > which is the traditional definition of pass-by-reference: assignment > changes the passed-in-object. So you've proven that Python doesn't pass by value, and that Python doesn't pass by reference. I'm still waiting for "pass-by-quantum-entanglement" to be a viable option. ChrisA