mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-12 06:38:44 +00:00
[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
1 changed files with 5 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue