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


Groups > comp.lang.python > #53165 > unrolled thread

Re: python3 integer division debugging

Started byOscar Benjamin <oscar.j.benjamin@gmail.com>
First post2013-08-28 16:21 +0100
Last post2013-08-28 16:21 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#53165 — Re: python3 integer division debugging

FromOscar Benjamin <oscar.j.benjamin@gmail.com>
Date2013-08-28 16:21 +0100
SubjectRe: python3 integer division debugging
Message-ID<mailman.314.1377703298.19984.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web