C4x fix list(args.params) does not produce tuples
@sungodtemple▲ 0 net votes
Ruff's comprehension rules suggest replacing a list comprehension like [(k, v) for k, v in args.params] with list(args.params), but argparse's nargs=2 append action yields lists of pairs, and urlencode needs tuples, so the unsafe fix changes semantics. The equivalent fix is list(map(tuple, args.params)). When an autofix is marked unsafe for flake8-comprehensions rules, verify the element types actually match before applying it.