Skip to content

IDLE: Update feature classes when options are changed. #75669

Closed

Description

@terryjreedy
BPO 31488
Nosy @terryjreedy, @csabella
PRs
  • bpo-31488: IDLE - update former extensions when options change. #3612
  • [3.6] bpo-31488: IDLE - update former extensions when options change. (GH-3612) #3613
  • 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 2017-09-16.04:16:21.665>
    labels = ['expert-IDLE', 'type-bug', '3.7']
    title = 'IDLE: Update feature classes when options are changed.'
    updated_at = <Date 2017-09-16.06:14:36.766>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2017-09-16.06:14:36.766>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = False
    closed_date = None
    closer = None
    components = ['IDLE']
    creation = <Date 2017-09-16.04:16:21.665>
    creator = 'terry.reedy'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31488
    keywords = ['patch']
    message_count = 3.0
    messages = ['302318', '302324', '302326']
    nosy_count = 2.0
    nosy_names = ['terry.reedy', 'cheryl.sabella']
    pr_nums = ['3612', '3613']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue31488'
    versions = ['Python 3.6', 'Python 3.7']

    Activity

    1. terryjreedy commented on Sep 16, 2017

      @terryjreedy
      MemberAuthor

      For this issue, a 'feature class' is a non-extension class with options configured on the config dialog. Currently there are 4 such classes, which were extension classes before conversion by bpo-27099.

      Currently, an extension class option takes effect either when IDLE is restarted and the module reads the value, or when a new instance is created and the instance reads the value. There is currently no mechanism to update existing instances.

      As part of the conversion, I gave each feature class a reload classmethod. The method is called at module level after the class is created. The idea was that these methods could also be called from ConfigDialog.activate_config_changes. This issue implements this idea.

      (Cheryl: testing the new code should be ideally be part of this patch and should be part of new tests for activate_config_changes you have worked on. I am going with manual tests for the moment because the cutoff for 3.6.3rc1 and 3.7.0a1 is next Monday, 12 UTC, about 55 hours from now.)

      If instances reread the class attribute each time they need it, then updating the class attribute updates all existing instances. An example is the autocomplete popup delay time.

      If instances only read the class attribute in __init__ and somehow freeze the value, then the class needs to keep track of instances so reload can refresh each. A current example of freezing is the parenmatch type. I will have to either unfreeze the attribute or add a registry set.

      Fixing up CodeContext will be a separate patch I am already working on.

      Applying the reload idea to extensions, in particular the example extension, is a much lower priority, and can wait until after the pending releases.

    2. self-assigned this
      on Sep 16, 2017
    3. added
      type-bug
      on Sep 16, 2017
    4. terryjreedy commented on Sep 16, 2017

      @terryjreedy
      MemberAuthor

      New changeset 5777ecc by Terry Jan Reedy in branch 'master':
      bpo-31488: IDLE - update former extensions when options change. (bpo-3612)
      5777ecc

    5. terryjreedy commented on Sep 16, 2017

      @terryjreedy
      MemberAuthor

      New changeset 77b52e4 by Terry Jan Reedy (Miss Islington (bot)) in branch '3.6':
      [3.6] bpo-31488: IDLE - update former extensions when options change. (GH-3612) (bpo-3613)
      77b52e4

    6. transferred this issue fromon Apr 10, 2022
    7. moved this to In Progress in IDLE Issueson Jul 27, 2022
    8. erlend-aasland commented on Jul 27, 2022

      @erlend-aasland
      Contributor

      Are there more work to be done here, or can we close this issue?

    9. serhiy-storchaka commented on Sep 15, 2026

      @serhiy-storchaka
      Member

      Done in #3612: every feature class has a reload() classmethod, ConfigDialog.activate_config_changes() calls them, and the classes read their options at use time, so open windows pick up the change.

    10. moved this from In Progress to Done in IDLE Issueson Sep 15, 2026
    11. terryjreedy commented on Sep 16, 2026

      @terryjreedy
      MemberAuthor

      Thanks for closing.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    topic-IDLEtype-bug

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions