MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / _get_boolean

Function _get_boolean

bson/__init__.py:421–431  ·  view source on GitHub ↗

Decode a BSON true/false to python True/False.

(
    data: Any, _view: Any, position: int, dummy0: Any, dummy1: Any, dummy2: Any
)

Source from the content-addressed store, hash-verified

419
420
421def _get_boolean(
422 data: Any, _view: Any, position: int, dummy0: Any, dummy1: Any, dummy2: Any
423) -> Tuple[bool, int]:
424 """Decode a BSON true/false to python True/False."""
425 end = position + 1
426 boolean_byte = data[position:end]
427 if boolean_byte == b"\x00":
428 return False, end
429 elif boolean_byte == b"\x01":
430 return True, end
431 raise InvalidBSON("invalid boolean value: %r" % boolean_byte)
432
433
434def _get_date(

Callers

nothing calls this directly

Calls 1

InvalidBSONClass · 0.90

Tested by

no test coverage detected