# lists
[x for x in iterable]
# dicts
{k: v for k, v in some_dict}
# sets
{e for e in iterable}
# lists
list(iterable)
# dicts
dict(some_dict)
# sets
set(iterable)
Instead of using an identitiy comprehension, consider using the list
, dict
or set
constructor. It is faster and simpler.