Skip to content

IDLE - Update code with pyupgrade #103668

Closed
Closed

Description

@terryjreedy

Item 7 for #87179. In #87179 (comment), Anthony Sottile suggestted running his program pyupgrade, which automates code updates. It would have done some of the things already done and will do some more. In response to my query, he said on another comment that it has been well tested on multiple packages to only do valid changes. His comment includes a bash command:
git ls-files -- Lib/idlelib | grep '\\.py$' | xargs pyupgrade --py36-plus
On Windows, use pyupgrade-directories or try above with git bash on idlelib and idle_test.

Linked PRs

Activity

  1. added a commit that references this issue on Apr 21, 2023
  2. sobolevn commented on Apr 21, 2023

    @sobolevn
    Member

    Two notes:

    1. --py36-plus -> --py311-plus
    2. It is a good practice to run pyugrade multiple times (until there are no new changes produced, because it might upgrade stuff several times: % -> .format -> f'')

    I've sent a demo PR (feel free to close if the diff is too large / not useful).

  3. added a commit that references this issue on Apr 23, 2023
  4. added a commit that references this issue on Apr 23, 2023
  5. added a commit that references this issue on Apr 24, 2023
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