classification
Title: 2to3 strips trailing L for long iterals in two fixers
Type: behavior Stage: resolved
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: aronacher Nosy List: aronacher, benjamin.peterson, fabiomcosta, python-dev
Priority: normal Keywords: needs review, patch

Created on 2008-12-08 11:09 by aronacher, last changed 2013-01-28 23:30 by python-dev. This issue is now closed.

Files
File name Uploaded Description Edit
remove_redundant.diff aronacher, 2008-12-08 11:09
Messages (5)
msg77296 - (view) Author: Armin Ronacher (aronacher) * (Python committer) Date: 2008-12-08 11:09
I noticed that fix_long and fix_numliterals both strip trailing Ls from
numbers.  That's redudant, one of them should be enough.

I attached a patch that removes the literal changing from the fix_long
fixer.  Because I'm not sure if that may be the correct fixer to modify
I didn't commit it but created an issue for review.
msg77389 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-12-09 03:53
I think this is the correct thing to do. Go ahead. (Did you see if any
of the long tests would be applicable in testing numliterals?)
msg77390 - (view) Author: Armin Ronacher (aronacher) * (Python committer) Date: 2008-12-09 06:54
Patch applied in [67679].

The tests were nearly the same, even with the same numbers :)
msg180873 - (view) Author: Fábio M. Costa (fabiomcosta) Date: 2013-01-28 18:29
I believe that since this change the 2to3 documentation is outdated.

http://docs.python.org/2/library/2to3.html#2to3fixer-long
http://docs.python.org/2/library/2to3.html#2to3fixer-numliterals
http://docs.python.org/3/library/2to3.html#2to3fixer-long
http://docs.python.org/3/library/2to3.html#2to3fixer-numliterals

They could be updated to something like this:

long
Renames long to int. Check `numliterals` if you want to strip the L suffix on long literals.

numliterals
Converts octal and long literals into the new syntax.

Sorry if this is not the right channel to send documentation bug reports.
msg180888 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-01-28 23:30
New changeset d5ee6d13af18 by Benjamin Peterson in branch '3.3':
fix long fixer docs (#4590)
http://hg.python.org/cpython/rev/d5ee6d13af18

New changeset 8b9910d8d27f by Benjamin Peterson in branch 'default':
merge 3.3 (#4590)
http://hg.python.org/cpython/rev/8b9910d8d27f

New changeset 6904e229833d by Benjamin Peterson in branch '2.7':
fix long fixer docs (#4590)
http://hg.python.org/cpython/rev/6904e229833d
History
Date User Action Args
2013-01-28 23:30:10python-devsetnosy: + python-dev
messages: + msg180888
2013-01-28 18:29:55fabiomcostasetnosy: + fabiomcosta

messages: + msg180873
versions: + Python 2.7, - 3rd party
2008-12-09 06:54:59aronachersetstage: patch review -> resolved
2008-12-09 06:54:50aronachersetstatus: open -> closed
resolution: fixed
messages: + msg77390
2008-12-09 03:53:41benjamin.petersonsetassignee: benjamin.peterson -> aronacher
messages: + msg77389
2008-12-08 11:09:16aronachercreate