diff --git a/crates/ruff_linter/src/rules/ruff/rules/collection_literal_concatenation.rs b/crates/ruff_linter/src/rules/ruff/rules/collection_literal_concatenation.rs index 6c9239ee47..60dcd09b34 100644 --- a/crates/ruff_linter/src/rules/ruff/rules/collection_literal_concatenation.rs +++ b/crates/ruff_linter/src/rules/ruff/rules/collection_literal_concatenation.rs @@ -33,6 +33,12 @@ use crate::fix::snippet::SourceCodeSnippet; /// bar = [1, *foo, 5, 6] /// ``` /// +/// ## Fix safety +/// +/// The fix is always marked as unsafe because the `+` operator uses the `__add__` magic method and +/// `*`-unpacking uses the `__iter__` magic method. Both of these could have custom +/// implementations, causing the fix to change program behaviour. +/// /// ## References /// - [PEP 448 – Additional Unpacking Generalizations](https://peps.python.org/pep-0448/) /// - [Python documentation: Sequence Types — `list`, `tuple`, `range`](https://docs.python.org/3/library/stdtypes.html#sequence-types-list-tuple-range)