Simplify Constant Sum¶
Sourcery refactoring id:
Simplify constant sum call.
sum(1 for book in books if book.author == "Terry Pratchett")
sum(book.author == "Terry Pratchett" for book in books)
sum add the values it treats
0. We make use
of this fact to simplify the generator expression inside the