Decode a BSON true/false to python True/False.
(
data: Any, _view: Any, position: int, dummy0: Any, dummy1: Any, dummy2: Any
)
| 419 | |
| 420 | |
| 421 | def _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 | |
| 434 | def _get_date( |
nothing calls this directly
no test coverage detected