Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #53165

Re: python3 integer division debugging

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 <oscar.j.benjamin@gmail.com>
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 <kvl470$b86$1@ger.gmane.org>
References <kvl470$b86$1@ger.gmane.org>
From Oscar Benjamin <oscar.j.benjamin@gmail.com>
Date Wed, 28 Aug 2013 16:21:09 +0100
Subject Re: python3 integer division debugging
To Neal Becker <ndbecker2@gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Cc Python List <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.314.1377703298.19984.python-list@python.org> (permalink)
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

Show key headers only | View raw


On 28 August 2013 16:15, Neal Becker <ndbecker2@gmail.com> 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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: python3 integer division debugging Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-08-28 16:21 +0100

csiph-web