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

Function validate_string_or_none

pymongo/common.py:256–260  ·  view source on GitHub ↗

Validates that 'value' is an instance of `basestring` or `None`.

(option: str, value: Any)

Source from the content-addressed store, hash-verified

254
255
256def validate_string_or_none(option: str, value: Any) -> Optional[str]:
257 """Validates that 'value' is an instance of `basestring` or `None`."""
258 if value is None:
259 return value
260 return validate_string(option, value)
261
262
263def validate_non_negative_int_or_basestring(option: Any, value: Any) -> Union[int, str]:

Callers

nothing calls this directly

Calls 1

validate_stringFunction · 0.85

Tested by

no test coverage detected