About Double Iteration with Generator Expression

In Python you can have nested iterations in generator expressions. For example, to find if any object is incomplete in two querysets, you can do this:

1
2
3
4
5
any((
    not obj.is_complete()
    for queryset in (queryset1, queryset2)
    for obj in queryset
))

Tips and Tricks Programming Python 3