Python

Python

Made by DeepSource

Redundant list comprehension can be replaced using generator PYL-R1728

Performance
Minor

Using a container in place of a generator for a calls that can accept both, slows down the performance. Consider using generators for all function calls which accept both containers and genertors.

Bad practice

# List comprehension is unnecessary here
set([student.name for student in student])
sum([y**2 for y in list(range(10))])

Recommended

set(student.name for student in students)
sum(y**2 for y in list(range(10)))