pylint-errors

R1721 (unnecessary-comprehension)

:x: Problematic code:

# lists
[x for x in iterable]

# dicts
{k: v for k, v in some_dict}

# sets
{e for e in iterable}

:heavy_check_mark: Correct code:

# lists
list(iterable)

# dicts
dict(some_dict)

# sets
set(iterable)

Rationale:

Instead of using an identitiy comprehension, consider using the list, dict or set constructor. It is faster and simpler.