MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / __bool__

Method __bool__

mongoengine/queryset/base.py:219–221  ·  view source on GitHub ↗

Avoid to open all records in an if stmt in Py3.

(self)

Source from the content-addressed store, hash-verified

217 return False if queryset.first() is None else True
218
219 def __bool__(self):
220 """Avoid to open all records in an if stmt in Py3."""
221 return self._has_data()
222
223 # Core functions
224

Callers

nothing calls this directly

Calls 1

_has_dataMethod · 0.95

Tested by

no test coverage detected