Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: What is a function parameter =[] for? Date: Thu, 26 Nov 2015 14:02:00 +1100 Lines: 57 Message-ID: References: <56547337.4000709@rece.vub.ac.be> <56547C53.8030407@rece.vub.ac.be> <5654864E.2070906@rece.vub.ac.be> <56549324.8020607@rece.vub.ac.be> <56549F15.40206@rece.vub.ac.be> <5654B037.6020107@rece.vub.ac.be> <56550273$0$1585$c3e8da3$5496439d@news.astraweb.com> <5655f27b$0$1614$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de M1qsPfqzG7vshuiOqkRjggr0emygI/bFJlSSu5Lgv4Fg== 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; 'cpython': 0.05; 'pypy': 0.07; 'supported,': 0.07; 'though:': 0.07; 'cc:addr:python-list': 0.09; 'python': 0.10; '2.7': 0.13; 'wed,': 0.15; 'thu,': 0.15; '(oracle': 0.16; '1:08': 0.16; 'broken,': 0.16; 'cc:name:python': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hint': 0.16; 'nonetheless': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'run.': 0.16; 'tuple,': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; '>>>': 0.20; 'versions': 0.20; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'work,': 0.21; '3.2': 0.22; '64-bit': 0.22; 'gcc': 0.22; 'dec': 0.23; 'header:In- Reply-To:1': 0.24; "doesn't": 0.26; 'chris': 0.26; 'compatible': 0.27; 'least': 0.27; 'message-id:@mail.gmail.com': 0.27; 'alan': 0.29; 'fast.': 0.29; "i'm": 0.30; 'changed': 0.33; 'builds': 0.33; 'server': 0.34; 'received:google.com': 0.35; 'done': 0.35; 'false': 0.35; 'nov': 0.35; 'something': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'say': 0.37; 'received:209.85.213': 0.37; 'seem': 0.37; 'received:209': 0.38; 'anything': 0.38; 'someone': 0.38; 'sure': 0.39; 'unable': 0.39; 'still': 0.40; 'more': 0.63; 'latest': 0.64; '>>>>>': 0.66; '26,': 0.72; '2.5.3': 0.84; '2.7.8': 0.84; '7:25': 0.84; 'chrisa': 0.84; 'to:none': 0.91; '2014,': 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=up9P44eElZlF6U+Hz8konNosBi1hTGutFu7wJ0xB+7U=; b=DMpn5oPKI56tyx9ueIYxQbJwYp/TnHsVgeR25BWZrUX5udunkIe6FG1v5On9kdGDin 9y7N96ZmcbvUZMIaF/8ty9Yo9r1KeQHAYb0FE34mEPVVSrRYqFofHRp47qwcqLFph19Q zbmEJeCNvHoy4jjPtNa24HqQZzuJh1WN4h38yJ/mCaLHe08RqwfzPKkPAE3NuiRamNLp 7WlcH5VBaiGYKiZ0lUEyJckj8pzMPyH9iDHAiKIrozWVbiSsmrQS28L9Ai9Me2AMsn6H eCh5UPYx4fdJdIf5aH/76uLm94hlRCh6eeX57ABy/F+/yBPxVrJ8dDrldjiwnQ8WVJb0 60xA== X-Received: by 10.50.30.6 with SMTP id o6mr904238igh.94.1448506920347; Wed, 25 Nov 2015 19:02:00 -0800 (PST) In-Reply-To: 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: , Xref: csiph.com comp.lang.python:99524 On Thu, Nov 26, 2015 at 1:46 PM, Ian Kelly wrote: > On Wed, Nov 25, 2015 at 7:25 PM, Chris Angelico wrote: >> On Thu, Nov 26, 2015 at 1:08 PM, Alan Bawden wrote: >>> (Note that nothing in the documentation I can find actually _guarantees_ >>> that a Python implementation will only have one unique empty tuple, but >>> I wouldn't be suprised if the following is nonetheless true in all >>> current implementations: >>> >>> >>> tuple([]) is tuple([]) >>> True >>> >>> ) >> >> Jython 2.5.3 (, Oct 8 2014, 03:39:09) >> [OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_85 >> Type "help", "copyright", "credits" or "license" for more information. >>>>> tuple([]) is tuple([]) >> False >> >> Python 2.7.8 (2.4.0+dfsg-3, Dec 20 2014, 13:30:46) >> [PyPy 2.4.0 with GCC 4.9.2] on linux2 >> Type "help", "copyright", "credits" or "license" for more information. >>>>>> tuple([]) is tuple([]) >> False > > Well, he did say all "current" implementations. CPython 2.7 may still > be supported, but that doesn't make it current. And anything at 2.5 is > just archaic. Those are the versions of Jython and PyPy available from the Debian Jessie repositories. I'm not sure what Jython's compatibility is, but this is at least reasonably current. But I grabbed the latest 2.x-compatible PyPy nightly: Python 2.7.10 (b4515dee6ebf, Nov 25 2015, 23:01:41) [PyPy 4.1.0-alpha0 with GCC 4.8.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``Every time someone argues with "Smalltalk has always done X", it is always a good hint that something needs to be changed fast. - Marcus Denker'' >>>> tuple([]) is tuple([]) False The latest PyPy3 nightly builds seem to be broken, though; I was unable to get one to run. The builds compatible with Python 3.2 work, though: Python 3.2.5 (b2091e973da6, Oct 19 2014, 18:29:55) [PyPy 2.4.0 with GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>> tuple([]) is tuple([]) False So current PyPy still behaves that way. ChrisA