Fixed #20989 -- Removed explicit list comprehension inside dict() and tuple()

Thanks jeroen.pulles at redslider.net for the suggestion and
helper script.