Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Random832 Newsgroups: comp.lang.python Subject: Re: What is a function parameter =[] for? Date: Thu, 26 Nov 2015 23:33:53 -0500 Lines: 32 Message-ID: References: <56550273$0$1585$c3e8da3$5496439d@news.astraweb.com> <5655f27b$0$1614$c3e8da3$5496439d@news.astraweb.com> <6imd5b9it55sucrcl95o95tppro7errfsi@4ax.com> <5657b30d$0$1600$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain X-Trace: news.uni-berlin.de 2s5sT70FxXqPutY4ICkqdgczprZROQI3iNuwKz+HdFTQ== Cancel-Lock: sha1:0hW6CwZClp2A1AWIK0+tM36y5mI= Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'pypy': 0.07; 'exiting': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'thu,': 0.15; 'hex': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'numerical': 0.18; '2015': 0.20; 'gcc': 0.22; 'seems': 0.23; 'unlike': 0.23; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'values': 0.28; 'for,': 0.29; "i'm": 0.30; "d'aprano": 0.33; 'received:comcast.net': 0.33; 'steven': 0.33; 'ones': 0.35; 'nov': 0.35; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'end': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.40; 'field': 0.60; 'different': 0.63; "they're": 0.66; 'farrance': 0.84 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: c-68-39-93-111.hsd1.in.comcast.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) 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:99624 Steven D'Aprano writes: > On Thu, 26 Nov 2015 09:34 pm, Dave Farrance wrote: > > >> (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 > > > I'm pretty sure that they are faked. The hex value may be instructive: 0x1ff800000000000020000000000000007L That's 0x3ff00000000000004000000000000000 << 3 | 7. 3ff000... is the double representation of 1, 400000... is 2. I bet that that three-bit field at the end has different values for all the different types they are "faked" for, and one for the ones that they're "not faked".