mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-17 02:53:01 +00:00
[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
1 changed files with 6 additions and 0 deletions
|
|
@ -32,6 +32,12 @@ use crate::{AlwaysFixableViolation, Edit, Fix};
|
||||||
/// If the items are hashable, use a `set` for efficiency; otherwise, use a
|
/// If the items are hashable, use a `set` for efficiency; otherwise, use a
|
||||||
/// `tuple`.
|
/// `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
|
/// ## Example
|
||||||
/// ```python
|
/// ```python
|
||||||
/// foo == "bar" or foo == "baz" or foo == "qux"
|
/// foo == "bar" or foo == "baz" or foo == "qux"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue