Presuming we need the sort that immediately follows this, we can cut out one unnecessary iteration by using the `sorted` builtin instead of first converting to a list and then sorting it: `subclasses = sorted(set(subclasses), key=len, reverse=True)`