[issue12831] 2to3 and integer division

2011-08-26 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Running python with the -3 command line option will warn about Python 3.x 
incompatibilities that 2to3 cannot trivially fix.

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12831] 2to3 and integer division

2011-08-26 Thread Alexander Rødseth

Alexander Rødseth  added the comment:

Even though it's hard to cover every case, it should be possible in quite a few 
cases:

self.maxstars = 4
half = self.maxstars / 2

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12831] 2to3 and integer division

2011-08-25 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +benjamin.peterson
resolution:  -> invalid
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12831] 2to3 and integer division

2011-08-25 Thread Mark Dickinson

Mark Dickinson  added the comment:

> "/ 2" is an integer division, so it should be "// 3" in Python 3.

No, I don't think that's right: 2to3 has no way of knowing that the programmer 
intended an integer division here (self.maxstars could be a float).

Instead, you should always use '//' in Python 2 code where an integer division 
is intended.

--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12831] 2to3 and integer division

2011-08-24 Thread Alexander Rødseth

New submission from Alexander Rødseth :

Hi,

2to3 is a great tool, but I think I found one case it doesn't catch, which is 
this change:

-half = self.maxstars / 2
+half = self.maxstars // 2

"/ 2" is an integer division, so it should be "// 3" in Python 3.

Thanks.

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 142879
nosy: alexander256
priority: normal
severity: normal
status: open
title: 2to3 and integer division
type: behavior
versions: Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com