BadPython.com

Suggestion for "Overly explicit empty-checks"

Do not use explicit comparison, subclasses of list might be given to a function, but will compare false to []
            
def list_check(ls: List[int]):
    if not ls:
        return None
    else:
        do_action_with_list(ls)