]> git.notmuchmail.org Git - notmuch/commitdiff
bindings/python: implement Threads().__nonzero__
authorSebastian Spaeth <Sebastian@SSpaeth.de>
Thu, 2 Jun 2011 14:28:00 +0000 (16:28 +0200)
committerSebastian Spaeth <Sebastian@SSpaeth.de>
Thu, 2 Jun 2011 14:28:00 +0000 (16:28 +0200)
 __nonzero__ checks if Threads() contains at least one more valid thread

 The existence of this function makes 'if Threads(): foo' work, as that
 previously implicitely called len() exhausting the iterator. This
 function makes `bool(Threads())` work repeatedly.

For further info, see http://docs.python.org/reference/datamodel.html.
Credits for the hint go to Brian May.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>

No differences found