[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:
Yunchi Pang 2025-06-20 08:40:44 -07:00 committed by GitHub
parent 23a3b6ef23
commit 073a71ca9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"