Skip to content

Commit 1108f66

Browse files
committed
add mention of side effects
1 parent 9ff01e3 commit 1108f66

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/ruff_linter/src/rules/pyflakes/rules/repeated_keys.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ use crate::registry::Rule;
4343
/// ## Fix safety
4444
///
4545
/// This rule's fix is marked as unsafe because removing a repeated dictionary key
46-
/// may delete comments that are attached to the removed key-value pair.
46+
/// may delete comments that are attached to the removed key-value pair. This can also change
47+
/// the program's behavior if the value expressions have side effects.
4748
///
4849
/// ## References
4950
/// - [Python documentation: Dictionaries](https://docs.python.org/3/tutorial/datastructures.html#dictionaries)
@@ -114,7 +115,8 @@ impl Violation for MultiValueRepeatedKeyLiteral {
114115
/// ## Fix safety
115116
///
116117
/// This rule's fix is marked as unsafe because removing a repeated dictionary key
117-
/// may delete comments that are attached to the removed key-value pair.
118+
/// may delete comments that are attached to the removed key-value pair. This can also change
119+
/// the program's behavior if the value expressions have side effects.
118120
///
119121
/// ## References
120122
/// - [Python documentation: Dictionaries](https://docs.python.org/3/tutorial/datastructures.html#dictionaries)

0 commit comments

Comments
 (0)