Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue2805] 2to3 doesn't correct divisions

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

May 9, 2008, 1:51 PM

Post #1 of 5 (195 views)
Permalink
[issue2805] 2to3 doesn't correct divisions

New submission from Guilherme Polo <ggpolo[at]gmail.com>:

Given the sample code:

for i in range(len([1, 2]) / 2): pass

print 2 / 3

2to3 tells no files need to be modified after running it over this code,
but range doesn't accept float values and the print result will differ.
Would it be too expensive for 2to3 to suggest changing '/' to '//' ?

----------
assignee: collinwinter
components: 2to3 (2.x to 3.0 conversion tool)
messages: 66486
nosy: collinwinter, gpolo
severity: normal
status: open
title: 2to3 doesn't correct divisions

__________________________________
Tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue2805>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 9, 2008, 2:04 PM

Post #2 of 5 (190 views)
Permalink
[issue2805] 2to3 doesn't correct divisions [In reply to]

Collin Winter <collinw[at]gmail.com> added the comment:

My gut feeling is that the number of cases where both operands are
written as literals is exceedingly small when compared to the number of
cases where one or both is an identifier. Since 2to3 doesn't support
type inference, we'd miss the relevant, interesting cases. However, if
you're interested in implementing a fix_literal_division fixer module
that would catch these cases, I'd be happy to advise on such a thing :)

__________________________________
Tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue2805>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 9, 2008, 2:26 PM

Post #3 of 5 (190 views)
Permalink
[issue2805] 2to3 doesn't correct divisions [In reply to]

Guilherme Polo <ggpolo[at]gmail.com> added the comment:

If I were to add such fixer, should I wait for changes coming by gsoc
projects ? I did a quick pass through 2to3 code a while ago, but I'm
very far from understanding it in a good manner so I'm not sure if I
should starting doing that now because it looks like a GSoC project is
planning to change how 2to3 works.

__________________________________
Tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue2805>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 9, 2008, 3:11 PM

Post #4 of 5 (189 views)
Permalink
[issue2805] 2to3 doesn't correct divisions [In reply to]

Collin Winter <collinw[at]gmail.com> added the comment:

I say do it before the GSoC projects complete. Those projects will take
months, and we can't stop development for that long.

__________________________________
Tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue2805>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 10, 2008, 6:15 AM

Post #5 of 5 (174 views)
Permalink
[issue2805] 2to3 doesn't correct divisions [In reply to]

Rodrigo Bernardo Pimentel <rbp[at]isnomore.net> added the comment:

+1 for going ahead and writing a fixer.

----------
nosy: +rbp

__________________________________
Tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue2805>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.