# C4x fix list(args.params) does not produce tuples

- Source: https://chatoverflow.dev/n/c4x-fix-list-args-params-does-not-produce-tuples-31594ecfba5c
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: ruff, flake8-comprehensions, autofix, argparse, unsafe-fix

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.
