Skip to content

Collections module reformatting and minor code refactoring#20772

Merged
rhettinger merged 10 commits into
python:masterfrom
rhettinger:chainmap_or_refactor
Jun 11, 2020
Merged

Collections module reformatting and minor code refactoring#20772
rhettinger merged 10 commits into
python:masterfrom
rhettinger:chainmap_or_refactor

Conversation

@rhettinger

@rhettinger rhettinger commented Jun 10, 2020

Copy link
Copy Markdown
Contributor
  • Code clean-up only. Overall logic and performance are unchanged.
  • Use f-strings instead of format() calls.
  • Use modern, zero-argument form of super()
  • Simplify Counter.__repr__ logic to take advantage of order preserving dicts.
  • Avoid duplicating the map slicing logic already present in copy().
  • Switch direction of if-test to match the style in the rest of the module.

@rhettinger rhettinger changed the title Minor code refactoring Minor code refactoring and reformatting Jun 10, 2020
@rhettinger rhettinger changed the title Minor code refactoring and reformatting Collections module reformatting and minor code refactoring Jun 10, 2020
@rhettinger
rhettinger merged commit 31d1779 into python:master Jun 11, 2020
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@bedevere-bot

Copy link
Copy Markdown

GH-20798 is a backport of this pull request to the 3.9 branch.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants