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

Function validate_boolean

pymongo/write_concern.py:27–31  ·  view source on GitHub ↗

Validates that 'value' is True or False.

(option: str, value: Any)

Source from the content-addressed store, hash-verified

25
26# Duplicated here to avoid a circular import.
27def validate_boolean(option: str, value: Any) -> bool:
28 """Validates that 'value' is True or False."""
29 if isinstance(value, bool):
30 return value
31 raise TypeError(f"{option} must be True or False, was: {option}={value}")
32
33
34class WriteConcern:

Callers 14

__init__Method · 0.90
__init__Method · 0.90
_parse_ssl_optionsFunction · 0.90
__set_check_hostnameMethod · 0.90
__init__Method · 0.90
__init__Method · 0.90
_updateMethod · 0.90
__init__Method · 0.90
_updateMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected