Skip to content

Commit 073a71c

Browse files
yunchipangdylwil3
andauthored
[pylint] add fix safety section (PLR1714) (#18415)
parent #15584 fix was introduced in #7910 --------- Co-authored-by: dylwil3 <dylwil3@gmail.com>
1 parent 23a3b6e commit 073a71c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

crates/ruff_linter/src/rules/pylint/rules/repeated_equality_comparison.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ use crate::{AlwaysFixableViolation, Edit, Fix};
3232
/// If the items are hashable, use a `set` for efficiency; otherwise, use a
3333
/// `tuple`.
3434
///
35+
/// ## Fix safety
36+
/// This rule is always unsafe since literal sets and tuples
37+
/// evaluate their members eagerly whereas `or` comparisons
38+
/// are short-circuited. It is therefore possible that a fix
39+
/// will change behavior in the presence of side-effects.
40+
///
3541
/// ## Example
3642
/// ```python
3743
/// foo == "bar" or foo == "baz" or foo == "qux"

0 commit comments

Comments
 (0)