Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed1a.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'value,': 0.03; 'subject:Python': 0.05; 'variable,': 0.07; '[1,': 0.09; 'argument,': 0.09; 'confuse': 0.09; 'immutable': 0.09; "object's": 0.09; 'received:internal': 0.09; 'thu,': 0.15; '(so,': 0.16; '2],': 0.16; 'equivalence': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:messagingengine.com': 0.16; 'substitute': 0.16; 'wrote:': 0.16; 'variable': 0.20; "aren't": 0.22; 'object.': 0.22; 'code.': 0.23; 'defined': 0.23; 'bit': 0.23; "i've": 0.24; 'header:In-Reply-To:1': 0.24; 'object,': 0.27; 'actual': 0.29; '*the': 0.29; 'hash': 0.29; 'operators': 0.29; 'objects': 0.29; 'operations': 0.31; '"the': 0.32; 'language.': 0.32; 'getting': 0.33; 'class': 0.33; 'michael': 0.33; 'surely': 0.33; 'another': 0.34; 'subject:?': 0.34; 'could': 0.35; 'to:addr :python-list': 0.35; 'represent': 0.35; 'but': 0.36; 'being': 0.36; 'there': 0.36; 'alone': 0.36; 'two': 0.37; 'should': 0.37; 'received:10': 0.37; 'subject:: ': 0.37; 'rather': 0.38; 'received:66': 0.38; 'to:addr:python.org': 0.39; 'where': 0.40; 'why': 0.40; 'even': 0.61; 'relationship': 0.61; 'from:no real name:2**0': 0.61; 'header:Message-Id:1': 0.62; 'different': 0.64; 'enjoy': 0.70; 'demand': 0.79; 'imagine': 0.96 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.us; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=q3BM0U8x5M4Z1BB9IOKP8EquYs4=; b=tJauVU YHcsg3IdDBzdmDNX1t0PhJA+8IQXlrS8wOMbSGAeW4nX/dEtgrgI25klZzut5rYb vtKwG4gMVSTMsiM4JSu87V3mwbnK+jcUBngFv9ueXBvgb0RgW+h0rpLdSvsZfGjy bAL/RQRCrMIY6YWEbXNROxOO7I31OMnouUDS8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=q3BM0U8x5M4Z1BB 9IOKP8EquYs4=; b=EbnZ6OKUXsIOB7kVc4gx5wQ1N4kvT6EXaujUatBa9NUgD4V KwdTZfG1eeUfJ2xdVA6EzOwB65G26Yf6jPnyrde0yM4ax+8YPS/z/r0/etAFTK9F Qbp8J/pTqQuwadtjktmj7Ep/jnfQroyKqqMQo/WQyz9ru5nH9f56B8UAbguM= X-Sasl-Enc: kKn32EPgOkJKk6DDqcMUbEy9WSTtJCsXcGIJYCG6eP8/ 1433440309 From: random832@fastmail.us To: python-list@python.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-96e2a13b Subject: Re: Can Python function return multiple data? Date: Thu, 04 Jun 2015 13:51:49 -0400 In-Reply-To: <55708CB4.3030305@gmail.com> References: <3bbe49da-e989-4a8c-a8a9-75d3a786f508@googlegroups.com> <557056f9$0$13009$c3e8da3$5496439d@news.astraweb.com> <1433438775.1905830.286978449.6430E548@webmail.messagingengine.com> <55708CB4.3030305@gmail.com> 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433440311 news.xs4all.nl 2821 [2001:888:2000:d::a6]:41753 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92081 On Thu, Jun 4, 2015, at 13:36, Michael Torrie wrote: > Surely two objects can hold the same value, or represent the same value > (number), without *having* to be the same object. I don't see why > people would assume, let alone demand that different objects > representing the same value be the same actual object. Why should it > even matter? Just relax and write code. I enjoy the forays into the the > technical, and even the pedantic, but this is getting a bit silly. I think I've solved the terminology problem... it's call-by-value, but the value of a variable, or an argument, or an expression, is not the value of the object, but rather it is the object (or, if you like, the id of the object.) So it's call-by-value where the object is the value that is _really_ passed in. "The value of an object" is simply an equivalence relationship (so, the value of [1, 2] is the same as the value of [1, 2] until one of them changes) defined by the hash and == operators of the object's class rather than having any meaning to the language. Imagine you have a, b = [1, 2], [1, 2]. If a and b had the same value, then you could substitute them - a[0] = 3 would have the same effect as b[0] = 3. Immutable objects confuse this, because there aren't any operations you can do to one that would cause its value to be different from another one that once had the same value, so people think the value of the variable is the value of the object rather than the value of the variable being *the object*.