Skip to content

Commit 23a3b6e

Browse files
authored
[Perflint] Small docs improvement to PERF401 (#18786)
<!-- Thank you for contributing to Ruff/ty! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? (Please prefix with `[ty]` for ty pull requests.) - Does this pull request include references to any relevant issues? --> ## Summary <!-- What's the purpose of the change? What does it do, and why? --> While reading the docs I noticed this paragraph on `PERF401`. It was added in the same PR that the bug with `:=` was fixed, #15050, but don't know why it was added. The fix should already take care of adding the parenthesis, so having this paragraph in the docs is just confusing since it sounds like the user has to do something. ## Test Plan <!-- How was it tested? --> N/A, no tests/functionality affected
1 parent 5b3a501 commit 23a3b6e

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

crates/ruff_linter/src/rules/perflint/rules/manual_list_comprehension.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ use ruff_text_size::{Ranged, TextRange};
4848
/// original = list(range(10000))
4949
/// filtered.extend(x for x in original if x % 2)
5050
/// ```
51-
///
52-
/// Take care that if the original for-loop uses an assignment expression
53-
/// as a conditional, such as `if match:=re.match("\d+","123")`, then
54-
/// the corresponding comprehension must wrap the assignment
55-
/// expression in parentheses to avoid a syntax error.
5651
#[derive(ViolationMetadata)]
5752
pub(crate) struct ManualListComprehension {
5853
is_async: bool,

0 commit comments

Comments
 (0)