add a __bool__ to Results in db.py

This commit is contained in:
Johnny Robeson 2016-06-02 01:07:02 -04:00
parent 790b1b5153
commit 7c39462ae6

View file

@ -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))