Python logoPython/
PYL-R1718

Consider using a set comprehensionPYL-R1718

Major severityMajor
Performance categoryPerformance

Although there is nothing syntactically wrong with this code, it is hard to read and can be simplified to a set comprehension. Using set comprehension is more performant since there is no need to create a transient list.

Bad practice

mapping = set([num for num in my_magic_nums])
mapping = {num for num in my_magic_nums}