Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed1.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'exist.': 0.09; 'integer,': 0.09; 'objects.': 0.09; 'received:internal': 0.09; 'sane': 0.09; 'java,': 0.15; 'thu,': 0.15; '"is': 0.16; '23,': 0.16; 'expect,': 0.16; 'invisible': 0.16; 'invisible,': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'pyobject': 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; 'wrote:': 0.16; "wouldn't": 0.16; 'integer': 0.18; 'java': 0.22; 'either.': 0.22; 'int,': 0.22; 'object.': 0.22; 'header:In-Reply-To:1': 0.24; 'all.': 0.24; 'no,': 0.29; 'point': 0.33; 'problem': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'subject:?': 0.34; 'to:addr:python-list': 0.35; 'really': 0.35; "isn't": 0.35; 'according': 0.36; 'but': 0.36; 'two': 0.37; 'received:10': 0.37; 'subject:: ': 0.37; 'received:66': 0.38; 'to:addr:python.org': 0.39; 'some': 0.40; 'from:no real name:2**0': 0.61; 'header:Message-Id:1': 0.62; '500': 0.63; 'different': 0.64; '23.': 0.84 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=UHI7UIKDNgXLagZSc8vl9O2l7qw=; b=CL0vse vYcoj+BMGlzfSxJCVDcsSmTrtGT7O7G10aPSeYAzMlR1ETHuWlIZXelnZ7rZblMa bPdH5hvj6FMNGYWSt/Yme8I9YNWmFoFYSDk1eqWj3aLz8m8vHwIFyya7rGhUPGyX tgmklzKArsuTg7AtgVU7dznQYjKV/PVH7zVPw= 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=UHI7UIKDNgXLagZ Sc8vl9O2l7qw=; b=dCf9Wq3TbF3P2zGsMZ+J0cJWwCs6OdwvmVE603prcxZW+xD eitsOJbBVbAPY8IVZvDIhLGCKvoLzMcThKMuGNegNloK+xZoa4FNFHyEZvDwTJ4f oecmpWOI/86rXt60JJnNplqXuGG044fcj4KTn4gf2JwA/3Ii9r3bpCiopN0U= X-Sasl-Enc: HBmjfoCVkA3XtwL10CgInYCZhenlOsCg7iC0k+52Ufv/ 1433438775 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:26:15 -0400 In-Reply-To: <557056f9$0$13009$c3e8da3$5496439d@news.astraweb.com> References: <3bbe49da-e989-4a8c-a8a9-75d3a786f508@googlegroups.com> <557056f9$0$13009$c3e8da3$5496439d@news.astraweb.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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433438784 news.xs4all.nl 2834 [2001:888:2000:d::a6]:44110 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92073 On Thu, Jun 4, 2015, at 09:47, Steven D'Aprano wrote: > In other words, according to this Java philosophy, following `x = 23`, > the > value of x is not 23 like any sane person would expect, but some > invisible > and unknown, and unknowable, reference to 23. Well, no, because, in Java, if the type of x is int, then the value really is 23. If it's Integer, then it's a reference to a boxed Integer object. Which is (thankfully) immutable. But isn't invisible, unknown, or unknowable at all. Of course, in CPython, the type of an object reference is PyObject *. Which isn't invisible, unknown, or unknowable, either. If the value really were 23, the "is vs ==" problem wouldn't exist. x = 500 y = x+1 z = y-1 x and z (probably) point to two different objects.