Skip to content

Clarify PERF402 iterable wording#25205

Closed
Sean-Kenneth-Doherty wants to merge 1 commit into
astral-sh:mainfrom
Sean-Kenneth-Doherty:codex/docs-manual-list-copy-iterable
Closed

Clarify PERF402 iterable wording#25205
Sean-Kenneth-Doherty wants to merge 1 commit into
astral-sh:mainfrom
Sean-Kenneth-Doherty:codex/docs-manual-list-copy-iterable

Conversation

@Sean-Kenneth-Doherty
Copy link
Copy Markdown

Summary

  • Update PERF402 docs to describe replacing a loop with list() over an iterable.
  • Remove the list.copy() suggestion from the diagnostic, since the source may not be a list.
  • Adjust the rule example to use range(10000) so it no longer implies the source is an existing list.

Closes #21593.

Test Plan

  • cargo test -p ruff_linter rules::perflint::tests::rules
  • cargo fmt --all --check
  • git diff --check

@Sean-Kenneth-Doherty

This comment was marked as spam.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@astral-sh-bot astral-sh-bot Bot requested a review from ntBre May 17, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

manual-list-copy rule description says it works on existing lists, but it triggers on any iterable

3 participants