This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IDLE: Factor out similar code in editor and hyperparser
Type: enhancement Stage: patch review
Components: IDLE Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: cheryl.sabella, taleinat, terry.reedy
Priority: normal Keywords: patch

Created on 2020-02-17 18:12 by cheryl.sabella, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 18539 open cheryl.sabella, 2020-02-17 18:31
PR 20847 open cheryl.sabella, 2020-06-13 00:08
Messages (3)
msg362153 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2020-02-17 18:12
Under issue32989, there was discussion about refactoring duplicate code between hyperparser and editor.

> Perhaps separate issue: the 'if use_ps1' statements in editor and hyperparser, and a couple of lines before, is nearly identical, and could be factored into a separate editor method that returns a parser instance ready for analysis.  It could then be tested in isolation.  The method should return a parser instance ready for analysis.
msg371206 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-06-10 14:26
The quote from #32989 is from my msg313179, msg313179.

There are two levels of duplication.  First, between Hyperparser and EditorWindow.  Second between editor and shell branches.  While I said before to resolve the first with an EditorWindow method, as done in the patch, a hyperparser function, with 'self' replaced by 'editwin' would be possible.  I might prefer that.

The second level of duplication could be handled by a method in EditorWindow overridden by a method in PyShell.  But with duplication between the branches removed as in the patch, leaving the Shell branch so short, this does not seem as worthwhile.  I suspect/expect it would be even less so after future Shell changes.
msg371428 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2020-06-13 00:09
PR20847 is an implementation with the parser function in hyperparser instead of EditorWindow.
History
Date User Action Args
2022-04-11 14:59:26adminsetgithub: 83847
2020-06-13 00:09:42cheryl.sabellasetmessages: + msg371428
2020-06-13 00:08:42cheryl.sabellasetpull_requests: + pull_request20040
2020-06-10 14:26:52terry.reedysetnosy: + taleinat
messages: + msg371206
2020-02-17 18:31:02cheryl.sabellasetkeywords: + patch
stage: patch review
pull_requests: + pull_request17916
2020-02-17 18:12:00cheryl.sabellacreate