Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ use crate::importer::ImportRequest;
/// functools.reduce(operator.iadd, lists, [])
/// ```
///
/// ## Fix safety
///
/// This fix is always marked as unsafe because `sum` uses the `__add__` magic method while
/// `operator.iadd` uses the `__iadd__` magic method, and these behave differently on lists.
/// The former requires the right summand to be a list, whereas the latter allows for any iterable.
/// Therefore, the fix could inadvertently cause code that previously raised an error to silently
/// succeed. Moreover, the fix could remove comments from the original code.
///
/// ## References
/// - [_How Not to Flatten a List of Lists in Python_](https://mathieularose.com/how-not-to-flatten-a-list-of-lists-in-python)
/// - [_How do I make a flat list out of a list of lists?_](https://stackoverflow.com/questions/952914/how-do-i-make-a-flat-list-out-of-a-list-of-lists/953097#953097)
Expand Down
Loading