Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.048 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.02; 'interpreter': 0.05; 'detect': 0.07; 'cc:addr:python-list': 0.11; 'python': 0.11; 'changes': 0.15; 'cc:name:python list': 0.16; 'porting': 0.16; 'subject:python3': 0.16; 'wrote:': 0.18; 'seems': 0.21; 'cc:addr:python.org': 0.22; 'integer': 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'header:In-Reply-To:1': 0.27; 'errors': 0.30; 'mode': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'division': 0.31; 'run': 0.32; 'received:google.com': 0.35; 'problems.': 0.60; 'most': 0.60; 'august': 0.61; 'such': 0.63; 'to:addr:gmail.com': 0.65; 'wish': 0.70; 'oscar': 0.84; 'silent': 0.95; '2013': 0.98 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:to :cc:content-type; bh=ipOXU65Sy4XHJuvGFUtCI8XKbgO5LpNxnfH4JPp/zvA=; b=r5NgLFJF9WFAUjw6R7/exLCzTRoNo0VJGnQBvS7l2L8+OWAklvaf/uyzK5OykB1K7b zYGVT/TyPgMx77Bdww9ylwIBet0co2HKTHyLnZB4eGXr4MthyFs5tL1gCtwSZG2K49xf awdaUIv4R4LHhiLhBeylw5nchLEzQYbX8tBZw7lkfv/0GRz6bRf4wIobJum2NJzKVv0e iJ7pwnDG1pGpK3uf+aaHYAlZkxw/fRqiFsQKb6XRbJq0umIBfVQn0dvcbKpEQVcMAmJu tAQW/BcxPEK8ee+3U5UqX+lS4SoR7PFnBTNGaf9rhllLF9lq0u26J9kPhsn2BOSCT2Rr TfGw== X-Received: by 10.220.97.145 with SMTP id l17mr516087vcn.35.1377703289926; Wed, 28 Aug 2013 08:21:29 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Oscar Benjamin Date: Wed, 28 Aug 2013 16:21:09 +0100 Subject: Re: python3 integer division debugging To: Neal Becker Content-Type: text/plain; charset=ISO-8859-1 Cc: Python List X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1377703298 news.xs4all.nl 16006 [2001:888:2000:d::a6]:51042 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53165 On 28 August 2013 16:15, Neal Becker wrote: > The change in integer division seems to be the most insidious source of silent > errors in porting code from python2 - since it changes the behaviour or valid > code silently. > > I wish the interpreter had an instrumented mode to detect and report such > problems. Is that a joke? Run the code under Python 2.6/2.7 with the -3 flag: $ cat test.py print(10 / 7) $ python -3 test.py test.py:2: DeprecationWarning: classic int division print(10 / 7) 1 Oscar