New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idle 2.7: update to simplify cross-version patches #62516
Comments
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? |
I wrote a short script (already uploded) to differ 2.7 and 3.3 versions of an idlelib file. Applied to PyShell, I see unnecessary differences, like 'a,b' changed to 'a, b', or 'not a in b' changed to 'a not in b' only in 3.3 (probably for 3.0 when the necessary changes were made). When working on a particular file, I would be inclined to make the obvious updates to 2.7 first. |
New changeset aa1350c7d196 by Terry Jan Reedy in branch '2.7': |
I am no longer patching IDLE for 2.7, partly because of the testing issue. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: