Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'subject:Python': 0.05; 'affected': 0.07; 'variant': 0.07; 'objects.': 0.09; 'tuple': 0.09; 'tuple.': 0.09; 'cc:addr:python- list': 0.10; 'python': 0.11; 'python.': 0.11; 'languages,': 0.15; 'alphabetical': 0.16; 'different,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hashable': 0.16; 'immutable,': 0.16; 'integers.': 0.16; 'perceived': 0.16; 'usage,': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; '2015': 0.23; 'references': 0.23; 'sat,': 0.23; 'slightly': 0.23; 'header:In-Reply-To:1': 0.24; 'words': 0.24; 'message-id:@mail.gmail.com': 0.28; "doesn't": 0.28; 'behaviour': 0.29; 'complain': 0.29; 'piece': 0.29; 'objects': 0.29; 'values': 0.30; 'fri,': 0.31; 'point': 0.33; 'common': 0.33; 'ordered': 0.33; 'surprised': 0.33; 'subject:?': 0.34; 'received:google.com': 0.34; 'that,': 0.34; 'something': 0.35; "isn't": 0.35; 'but': 0.36; 'being': 0.36; 'there': 0.36; 'two': 0.37; 'subject:: ': 0.37; 'list.': 0.37; 'means': 0.39; 'pm,': 0.39; 'takes': 0.39; 'even': 0.61; 'information': 0.62; 'phone.': 0.63; 'skip:n 10': 0.63; 'different': 0.64; 'account': 0.67; 'phone': 0.67; 'chrisa': 0.84; 'concept.': 0.84; 'etc),': 0.84; 'writing.': 0.84; 'to:none': 0.90; 'careful': 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=QIYqzMYb/67pKDP5VqlfeVhpNc5BWT6HiYtpNkdgaNA=; b=cZqsu+M/knazMoVyEbmW25fbaRch4p2rfrQeC6n1S5NyPtDhNeJ4ltfnvv2Ee4GDXi TnXKzsVOoWM3d6dr4+w8SEXZ9hXG/gFPIXKo7w58FLMstjTqXRWoilhF5OTtxOdPmzGR yxKQZTO4MLWHNtIj60CK6NFWrHWssGwbIT5TRfSB7Ciju252igcTMZFsbIrdTbZr/hBQ 3K2ctenWc2oQ3+E+UFuSYZwTWgun6C4mFg+BkPD1ggICSaAW2qUuFj1W2Uze/Mmi7m9Y FutrZwKQNICDw8FibCM0rtcrrLEpj7ZRq3FuOVu/zdur0w16vGyP/dGdhOdLU3cdLZnJ 7qjw== MIME-Version: 1.0 X-Received: by 10.50.176.228 with SMTP id cl4mr1729925igc.2.1433562584843; Fri, 05 Jun 2015 20:49:44 -0700 (PDT) In-Reply-To: <1433561280.1469545.288250601.0749B2DA@webmail.messagingengine.com> References: <3bbe49da-e989-4a8c-a8a9-75d3a786f508@googlegroups.com> <557056f9$0$13009$c3e8da3$5496439d@news.astraweb.com> <5570ce43$0$12991$c3e8da3$5496439d@news.astraweb.com> <55710b69$0$12980$c3e8da3$5496439d@news.astraweb.com> <6c78b294-efd6-4096-a572-1841aa71a5eb@googlegroups.com> <557182af$0$13014$c3e8da3$5496439d@news.astraweb.com> <33a2f501-5587-4fd9-91fa-7094d4f6c512@googlegroups.com> <81cb1232-ecf8-4cf0-b29c-ecf2ca47ade0@googlegroups.com> <1433561280.1469545.288250601.0749B2DA@webmail.messagingengine.com> Date: Sat, 6 Jun 2015 13:49:44 +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: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433562594 news.xs4all.nl 2859 [2001:888:2000:d::a6]:48394 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92168 On Sat, Jun 6, 2015 at 1:28 PM, wrote: > On Fri, Jun 5, 2015, at 23:20, Rustom Mody wrote: >> The word immutuable happens to have existed in English before python. >> I also happen to have used it before I knew of python >> The two meanings do not match >> I am surprised >> Is that surprising? > > They don't match only if you consider the objects a tuple references to > be part of the tuple. > > You cannot change the reference. It will always point to the same list. Precisely. I can use indelible ink to write a phone number on a piece of paper, but that's no guarantee that the same person will always answer that phone. Doesn't change the indelibility of the writing. If you want something truly immutable, you have to be careful to reference only other immutables. In Python, hashability is pretty much that, but I don't think English has such a concept. Even if there is a word in English with a slightly different meaning from its Python meaning, is that so hard to believe? In common usage, a "dictionary" is something which maps words to their meanings, is ordered ("dictionary order" being a variant of alphabetical order which takes into account non-alphabetic characters, diacriticals, etc), and may have additional information that isn't strictly part of the mapping. In Python, a "dictionary" is something which maps hashable values to objects. That's pretty different, but clearly connected. In many languages, "integer" actually means "integer less than X" (eg X = 2**32), but people don't complain that that means they're not integers. In Python, immutables can contain references to mutables, and the perceived behaviour of a tuple may be affected by those objects. They're still immutable. ChrisA