Skip to content

IDLE: Factor out similar code in editor and hyperparser #83847

Open

Description

@csabella
BPO 39666
Nosy @terryjreedy, @taleinat, @csabella
PRs
  • gh-83847: IDLE - Refactor common code between hyperparser and editor #18539
  • gh-83847: IDLE - Refactor common code between hyperparser and editor #20847
  • 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:

    assignee = 'https://github.com/terryjreedy'
    closed_at = None
    created_at = <Date 2020-02-17.18:12:00.743>
    labels = ['expert-IDLE', 'type-feature', '3.9']
    title = 'IDLE: Factor out similar code in editor and hyperparser'
    updated_at = <Date 2020-06-13.00:09:42.603>
    user = 'https://github.com/csabella'

    bugs.python.org fields:

    activity = <Date 2020-06-13.00:09:42.603>
    actor = 'cheryl.sabella'
    assignee = 'terry.reedy'
    closed = False
    closed_date = None
    closer = None
    components = ['IDLE']
    creation = <Date 2020-02-17.18:12:00.743>
    creator = 'cheryl.sabella'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39666
    keywords = ['patch']
    message_count = 3.0
    messages = ['362153', '371206', '371428']
    nosy_count = 3.0
    nosy_names = ['terry.reedy', 'taleinat', 'cheryl.sabella']
    pr_nums = ['18539', '20847']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue39666'
    versions = ['Python 3.9']

    Activity

    1. csabella commented on Feb 17, 2020

      @csabella
      ContributorAuthor

      Under bpo-32989, 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.

    2. terryjreedy commented on Jun 10, 2020

      @terryjreedy
      Member

      The quote from bpo-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.

    3. csabella commented on Jun 13, 2020

      @csabella
      ContributorAuthor

      PR20847 is an implementation with the parser function in hyperparser instead of EditorWindow.

    4. transferred this issue fromon Apr 10, 2022
    5. moved this to In Progress in IDLE Issueson Jul 27, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions