-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Unused imports, variables, file in IDLE #67373
Comments
The IDLE code base has several unused imports and local variables. The testcode.py file seems to have been accidentally checked in. These changes were found through a lint program, not by hand. All idle unit tests pass after these changes. |
I am aware of some of these from running PyChecker over idlelib, but had not gotten around to an global patch yet. The unit test coverage is still woefully incomplete, so I will want to check each deletion. I have been meaning to delete testcode.py, but in a separate commit. |
New changeset 1c3f8d044589 by Terry Jan Reedy in branch '2.7': New changeset 364e44a49a31 by Terry Jan Reedy in branch '3.4': |
There were errors in the patch. |
I've updated the patch. I've removed the EditorWindow deletion. Importing that and using it as a class variable instead of using an assignment statement wasn't picked up. (Is there a more opaque way to do this import?) I've left the RemoteDebugger.py change in. The frame variable name is (confusingly) reused: frame = frametable[fid]
# ...cut for brevity...
stack, i = self.idb.get_stack(frame, tb)
stack = [(wrap_frame(frame), k) for frame, k in stack] Changed to:
The first use of frame is eliminated by simply using frametable[fid] instead. The second use is as the temporary variable inside the list comprehension, which means the "frame" name is reused. With this change, the only time the frame local variable is used is in the list comprehension. This gets rid of the name reuse and makes it a bit simpler. |
*more transparent, that is. Not opaque. |
I got hg working and pushed the patch I had in January as a980da5f79f9, 5386aedf3ac9, 15701e89d710, and 3fa58e779308. Having forgotten that this issue was on the tracker (rather than just idle-sig post), I omitted the issue number and acknowledgement for the initial patch. I will add both when I add a new entry. I am working on another patch to include maxOsSupport and other changes found by pyflakes. I will add in the 'frame' change, the double use *is* confusing. pyflakes identifies files with * imports with a note that this prevents checks. I try to removed them when adding tests. I might do more just to make files checkable. |
News entry, not new entry (Cannot edit commit messages) |
More idlelib fixes. Will push after reviewing. pyflakes shows extraneous items in idle_test also. |
New changeset d50d661a08f5 by Terry Jan Reedy in branch '2.7': New changeset 777569dd4bca by Terry Jan Reedy in branch '3.4': New changeset 6c424b06320b by Terry Jan Reedy in branch 'default': |
New changeset 8875d7c6a99d by Terry Jan Reedy in branch '2.7': New changeset 526ce81f700d by Terry Jan Reedy in branch '3.4': New changeset 2a56eb5c08cc by Terry Jan Reedy in branch 'default': |
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: