[New-bugs-announce] [issue18316] Idle 2.7: update to simply cross-version patches
Terry J. Reedy
report at bugs.python.org
Thu Jun 27 22:21:36 CEST 2013
New submission from Terry J. Reedy:
In a commiters-list discussion of heuristics for what patches can go into non-Idle 2.7, Nick Coghlan offered "simplifying cross-version maintenance". (He also mentioned "addressing issues that arise due to changes in the underlying platforms", which is another issue I will open.)
Because of PEP 434 and the subsequent application of most Idle patches to all current versions, cross-version consistency is even more important for idlelib than the rest of the repository. When backporting patches, both context and changed lines must match. My experience so far is that merge conflicts are normal. So I think the latitude for consistency patches to reduce these should be even wider than for the rest of the repository. On the other hand, the current lack of tests suggests more caution than for the rest of the repository.
For this issue, I would like to at least change "except exception, e:" to "except exception as e:". This is about as safe as anything, and grepping 2.7 idlelib for "except .*, *." yields 23 hits where the ',' is not for multiple exceptions.
2.7 has about 80 print statements. While I would not change all in one patch (maybe 4), all in any file should be changed together when the future import is added at the top. Once this is done, forgetting to add parens or convert '>> file' results in a SyntaxError. So this is also pretty safe if the file compiles.
Current uses of int() seem to be for str or float conversion, not a/b truncations. That is already done with a//b.
There do not seem to be any unicode string literals.
Have I forgotten any generic ways to make 2.7 code the same as 3.x?
nosy: ncoghlan, roger.serwy, terry.reedy
stage: needs patch
title: Idle 2.7: update to simply cross-version patches
versions: Python 2.7
Added file: http://bugs.python.org/file30714/differ23.py
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce