Python

Python

Made by DeepSource

Consider using a set comprehension PYL-R1718

Performance
Major
Autofix

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])

Recommended

mapping = {num for num in my_magic_nums}