mirror of
https://github.com/beetbox/beets.git
synced 2026-01-16 21:25:14 +01:00
add a __bool__ to Results in db.py
This commit is contained in:
parent
790b1b5153
commit
7c39462ae6
1 changed files with 5 additions and 0 deletions
|
|
@ -593,6 +593,11 @@ class Results(object):
|
|||
return self._row_count
|
||||
|
||||
def __nonzero__(self):
|
||||
"""Does this result contain any objects?
|
||||
"""
|
||||
return self.__bool__()
|
||||
|
||||
def __bool__(self):
|
||||
"""Does this result contain any objects?
|
||||
"""
|
||||
return bool(len(self))
|
||||
|
|
|
|||
Loading…
Reference in a new issue