Validate the type of method arguments that expect a document.
(option: str, value: Any)
| 534 | |
| 535 | |
| 536 | def validate_is_mapping(option: str, value: Any) -> None: |
| 537 | """Validate the type of method arguments that expect a document.""" |
| 538 | if not isinstance(value, abc.Mapping): |
| 539 | raise TypeError( |
| 540 | f"{option} must be an instance of dict, bson.son.SON, or " |
| 541 | "any other type that inherits from " |
| 542 | "collections.Mapping" |
| 543 | ) |
| 544 | |
| 545 | |
| 546 | def validate_is_document_type(option: str, value: Any) -> None: |