Path: csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!ecngs!testfeeder.ecngs.de!81.171.118.63.MISMATCH!peer03.fr7!news.highwinds-media.com!peer01.am1!peering.am1!npeersf04.am4!fx46.am4.POSTED!not-for-mail From: Dave Farrance Newsgroups: comp.lang.python Subject: Re: What is a function parameter =[] for? Reply-To: DaveFarrance@yahoo.co.uk.invalid Message-ID: <6imd5b9it55sucrcl95o95tppro7errfsi@4ax.com> References: <56550273$0$1585$c3e8da3$5496439d@news.astraweb.com> <5655f27b$0$1614$c3e8da3$5496439d@news.astraweb.com> X-Newsreader: Forte Agent on Wine 5.00/32.1171 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 36 NNTP-Posting-Host: 80.193.198.211 X-Complaints-To: http://netreport.virginmedia.com X-Trace: 1448534084 80.193.198.211 (Thu, 26 Nov 2015 10:34:44 UTC) NNTP-Posting-Date: Thu, 26 Nov 2015 10:34:44 UTC Organization: virginmedia.com Date: Thu, 26 Nov 2015 10:34:43 +0000 X-Received-Body-CRC: 3541343670 X-Received-Bytes: 2411 Xref: csiph.com comp.lang.python:99549 Alan Bawden wrote: >Chris Angelico writes: > ... >> 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 > >I said I wouldn't be suprised if it was always true, but that doesn't >imply that I need to be suprised if it is sometimes false! > >Having said that, I _am_ curious whether that remains False for various >other variant expressions. "tuple([])" is actually a rather perverse >way to obtain an empty tuple. How about plain "() is ()"? ... Still false in PyPy it seems [PyPy 2.6.1 with GCC 4.9.2] on linux2 >>>> id(()) 139836165383760L >>>> id(()) 139836165383776L (Conversely, I see that unlike CPython, all PyPy's numbers have unchanging ids, even after exiting PyPy and restarting, so it seems that PyPy's numerical ids are "faked".) [PyPy 2.6.1 with GCC 4.9.2] on linux2 >>>> id(1+2j) 679900119843984469027190799480815353863L [PyPy 2.6.1 with GCC 4.9.2] on linux2 >>>> id(1+2j) 679900119843984469027190799480815353863L