Skip to content

IDLE: Simplify configdialog.HighPage.theme_elements dict #111050

Closed

Description

@terryjreedy

This dict maps a selection-list display phrase, such as "Normal Code or Text", to the internal name for the theme, which is here "normal". In order to display the display phrase keys in a deterministic order, the internal name values were combined in a tuple with the the desired position of the display name in the selection list. This is used to sort the list. Hence, the first pair in the theme_elements definition is currently "'Normal Code or Text': ('normal', '00')". Now that dict keys iterate in insertion order, the position value is no longer needed. (The definition display already has items in their desired order.)

Remove the position values and make the internal name the item value. Remove the redundant sorting of display phrases. Simplify internal name access by removing the '[0]' index to get the first element of a tuple. (As a side effect, we will be able to alter the order without changing the hard-coded positions.)

Linked PRs

Activity

  1. added 2 commits that reference this issue on Oct 19, 2023
  2. added 2 commits that reference this issue on Oct 19, 2023
  3. added 2 commits that reference this issue on Oct 19, 2023
  4. hugovk commented on Nov 9, 2023

    @hugovk
    Member

    Closing as PRs merged, thanks!

  5. added a commit that references this issue on Feb 11, 2024
  6. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions