Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Assignment Versus Equality Date: Wed, 29 Jun 2016 16:26:46 +1000 Lines: 30 Message-ID: References: <8a53c069-ca13-47bf-a24e-d2393a018b22@googlegroups.com> <4e72d24b-07b4-484c-83f8-a1fecc727f8c@googlegroups.com> <5773340f$0$1616$c3e8da3$5496439d@news.astraweb.com> <34aa9c69-cdd5-437c-a32b-9a706ef6d9c0@googlegroups.com> <26418be9-3d0c-4389-99e0-785efc9b88df@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de fxDzqGKQHOJ03+NKCU6fggMJYnHlm+TuIZfwYn7mFutQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'cpython': 0.05; 'pypy': 0.07; 'cc:addr:python-list': 0.09; '(int': 0.09; 'integers': 0.09; 'python': 0.10; 'wed,': 0.15; '2016': 0.16; 'code?': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'magic': 0.16; 'py3': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'steep': 0.16; 'tax?': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; 'thanks.': 0.18; 'language': 0.19; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'machine': 0.21; 'exists.': 0.22; 'int,': 0.22; 'thus': 0.24; 'header:In-Reply- To:1': 0.24; "doesn't": 0.26; 'separate': 0.27; 'question': 0.27; 'message-id:@mail.gmail.com': 0.27; 'boundary': 0.29; 'sure,': 0.29; "i'm": 0.30; 'that.': 0.30; 'too.': 0.30; 'another': 0.32; 'generally': 0.32; 'instead,': 0.33; 'shift': 0.33; 'that,': 0.34; 'gets': 0.35; 'received:google.com': 0.35; 'but': 0.36; 'there': 0.36; 'possible': 0.36; 'depends': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'thought': 0.37; 'doing': 0.38; 'anything': 0.38; 'someone': 0.38; 'data': 0.39; 'does': 0.39; 'some': 0.40; 'future': 0.60; 'within': 0.64; 'real-world': 0.66; 'transparent': 0.66; 'worth': 0.67; 'surprise': 0.72; 'chrisa': 0.84; 'proving': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc :content-transfer-encoding; bh=oG4U/xZOWqKo/aNzi5w6mrRQu0lapMTSxSKIL/Uo4II=; b=N7EyqpOKPYEfLrHpbLOaZU5vZxf+qaH1jdmBnAHKRFzsgEXSfOlkU6OQMKz+s1c/5n +e0Ay/fwgfaxk3ipBgnPhNdh8KxDr7URubpx8wY2NdZGEEDd8aUPEqSNEUiPoWza6hbW G+1hmeHWtmMP7zIguyapNS7vFS3HCwMNnLHIQMdIO7EoovrDOgk/bnkNaNdQ03FUTRzW APfVEyqu77q04p2xlYqWSPYrFhYuyXmd20GnpTWZUGabyuMsUjLPyfTzcDU1iOtxDTZl 6BMfK3sB+90uZT55kdmI1aSyMSFKJsAHbtGgXewbjRzs7BAgTGwF9ZCcp1IOeGQX+zby c3Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc:content-transfer-encoding; bh=oG4U/xZOWqKo/aNzi5w6mrRQu0lapMTSxSKIL/Uo4II=; b=N9gbEUDTLA3kNNQWraeHeSTa/csPapwynI6z4kuIKwK5u6DbBgs2Q8F+TH9txi5MuG OgCnQdbtk42uaERgcaepUYt17a2A7e/9xPQkEUwcnuHMXDoMLVQLy3VS2V45CaX6zddv d3oP+ou5hi8ZVlJAxqwF0hRq8RiyIqNHfOGELhzRDoRA92vIF49e+mNSHKMMzw/V8ffK wKEx7Yg9jOhvcD44tgQ8nBNk22YxzVYiTUkmX4MJEf4ztAfR7MhrBY5NoepdlNMmcDA7 X9bWNn36qu+bWtDreg6fDnqsIWDi5madNCyrVvQtt6rv/MJ85+Zy8bKV9r73M2PLDV6w ldUw== X-Gm-Message-State: ALyK8tJr8pfrwoRsU3lZEB5GDGw1/1TlEf3mxDrXfVrc/Vys8A7NtVtzcu94gl5lHYbjVKj/2VJ7housOA3zSQ== X-Received: by 10.194.97.201 with SMTP id ec9mr6512942wjb.117.1467181608296; Tue, 28 Jun 2016 23:26:48 -0700 (PDT) In-Reply-To: <26418be9-3d0c-4389-99e0-785efc9b88df@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <8a53c069-ca13-47bf-a24e-d2393a018b22@googlegroups.com> <4e72d24b-07b4-484c-83f8-a1fecc727f8c@googlegroups.com> <5773340f$0$1616$c3e8da3$5496439d@news.astraweb.com> <34aa9c69-cdd5-437c-a32b-9a706ef6d9c0@googlegroups.com> <26418be9-3d0c-4389-99e0-785efc9b88df@googlegroups.com> Xref: csiph.com comp.lang.python:110755 On Wed, Jun 29, 2016 at 3:55 PM, Rustom Mody wrote: >> The transparent shift from machine-word to bignum is what no longer >> exists. Both Py2 and Py3 will store large integers as bignums; Py2 has >> two separate data types (int and long), with ints generally >> outperforming longs, but Py3 simply has one (called int, but >> functionally like Py2's long), and does everything with bignums. >> There's no longer a boundary - instead, everything gets the "bignum >> tax". How steep is that tax? I'm not sure, but microbenchmarking shows >> that there definitely is one. How bad is it in real-world code? No >> idea. >> >> ChrisA > > New to me -- thanks. > I thought it did an FSR type covert machine word =E2=86=92 BigInt convers= ion under the hood. > Tax is one question > Justification for this change is another CPython doesn't currently do anything like that, but it would be perfectly possible to do it invisibly, and thus stay entirely within the language spec. I'm not aware of any Python implementation that does this, but it wouldn't surprise me if PyPy has some magic like that. It's PyPy's kind of thing. It's also entirely possible that a future CPython will have this kind of optimization too. It all depends on someone doing the implementation work and then proving that it's worth the complexity. ChrisA