mirror of https://github.com/astral-sh/ruff
[`pylint`] add fix safety section (`PLR1714`) (#18415)
parent #15584 fix was introduced in #7910 --------- Co-authored-by: dylwil3 <dylwil3@gmail.com>
This commit is contained in:
parent
23a3b6ef23
commit
073a71ca9a
|
|
@ -32,6 +32,12 @@ use crate::{AlwaysFixableViolation, Edit, Fix};
|
|||
/// If the items are hashable, use a `set` for efficiency; otherwise, use a
|
||||
/// `tuple`.
|
||||
///
|
||||
/// ## Fix safety
|
||||
/// This rule is always unsafe since literal sets and tuples
|
||||
/// evaluate their members eagerly whereas `or` comparisons
|
||||
/// are short-circuited. It is therefore possible that a fix
|
||||
/// will change behavior in the presence of side-effects.
|
||||
///
|
||||
/// ## Example
|
||||
/// ```python
|
||||
/// foo == "bar" or foo == "baz" or foo == "qux"
|
||||
|
|
|
|||
Loading…
Reference in New Issue