Python

Python

Made by DeepSource

Consider using any PY-W0074

Anti-pattern
Major
Autofix

It is recommended to use any for this loop, as it will make your code smaller and more readable.

Bad practice

def has_ten(my_list):
    for item in my_list:
        if item == 10:
            return True
    return False

Recommended

def has_ten(my_list):
    return any(item == 10 for item in my_list)