Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

IDLE: Simplify configdialog.HighPage.theme_elements dict #111050

Copy link
Copy link
Closed
@terryjreedy

Description

@terryjreedy
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done
    Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.