mirror of https://github.com/astral-sh/ruff
[`pylint`] add fix safety section (`PLE4703`) (#17824)
This PR adds a fix safety section in comment for rule PLE4703. parent: #15584 impl was introduced at #970 (couldn't find newer PRs sorry!)
This commit is contained in:
parent
b2d9f59937
commit
d545b5bfd2
|
|
@ -38,6 +38,11 @@ use crate::checkers::ast::Checker;
|
|||
/// nums.add(num + 5)
|
||||
/// ```
|
||||
///
|
||||
/// ## Fix safety
|
||||
/// This fix is always unsafe because it changes the program’s behavior. Replacing the
|
||||
/// original set with a copy during iteration allows code that would previously raise a
|
||||
/// `RuntimeError` to run without error.
|
||||
///
|
||||
/// ## References
|
||||
/// - [Python documentation: `set`](https://docs.python.org/3/library/stdtypes.html#set)
|
||||
#[derive(ViolationMetadata)]
|
||||
|
|
|
|||
Loading…
Reference in New Issue