[ruff] add fix safety section (RUF017)#17480
Conversation
|
ruff] add fix safety section (RUFF017)ruff] add fix safety section (RUF017)
|
Thanks for this! Looking at the implementation for this rule, I notice that it is only emitted when the user explicitly provides the However, there is a small difference in implementation between So, unless I'm misunderstanding, I think the only thing the fix could do that would change behavior is turn code that used to raise an exception into code that no longer raises an exception. Namely: import functools
import operator
ranges = [range(2), range(3)]
# raises a TypeError
sum(ranges, [])
# evaluates to [0, 1, 0, 1, 2]
functools.reduce(operator.iadd, ranges, [])So maybe we can reword the fix safety section in light of this? |
|
Hey @dylwil3 Perhaps something on this direction? Another question: what is the politic with deleted comments? Should this be mentioned in the |
dylwil3
left a comment
There was a problem hiding this comment.
Thank you! Your wording was good - I added it in with some minor corrections.
The PR add the
fix safetysection for ruleRUF017(#15584 )