diff options
author | 2011-06-02 17:28:50 +0200 | |
---|---|---|
committer | 2011-06-02 17:28:50 +0200 | |
commit | aeecafa694e8296411ad21cee1b7de094600babf (patch) | |
tree | 37cc6a6f95cc3fd4adb1adfc4e1949527dbbc2cb /debian | |
parent | 01cc4a31155dc71643fce1b619778493c1ff0dd7 (diff) |
bindings/python: Implement Tags().__nonzero__()
Analog to Threads.__nonzero__ this allows us to perform list() on a Threads() object and to repeatedly call "if Tags():" or "bool(Tags())" without implicitly invoking len(), thus exhausting our iterator.
While touching this code, I added a small micro-optimization to the Tag next() function. There is no need to explicitly check _is_valid, as _get implicitly does check for validness and returns None, if there is no more Tag to fetch. This avoids some roundtrips into the library when iterating through Tags.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Diffstat (limited to 'debian')
0 files changed, 0 insertions, 0 deletions