MCPcopy Create free account
hub / github.com/webpy/webpy / __bool__

Method __bool__

web/db.py:545–555  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

543 return super().__next__()
544
545 def __bool__(self):
546 # The ResultSet class class doesn't need to support __bool__ explicitly
547 # because it has __len__. Since SqliteResultSet doesn't support len,
548 # we need to peep into the result to find if the result is empty of not.
549 if self._head is None:
550 try:
551 self._head = next(self)
552 self._index -= 1 # reset the index
553 except StopIteration:
554 return False
555 return True
556
557
558class Transaction:

Callers

nothing calls this directly

Calls 1

nextFunction · 0.85

Tested by

no test coverage detected