There are many opinions on this topic, I can only speak from coding conventions in my organization.
There are many ways to influence the cycle, but a key attribute of understanding lists is that they create lists with one element for each in a repeated sequence.
>>> import Queue >>> q = Queue.Queue() >>> [q.put(item) for item in range(5)] [None, None, None, None, None] >>>
this unused list is clearly wasteful. Thus, this is a construction, an understanding of a list with an unused return value; It is forbidden to appear in our code base. An explicit loop like the one above, or generated in combination with what it consumes, for example:
>>> any(q.put(item) for item in xrange(5)) False >>>
or simply:
>>> for item in xrange(5): ... q.put(item) ... >>>
required to pass a review.
SingleNegationElimination
source share