MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / deep_mapping

Function deep_mapping

src/licensedcode/_vendor/attr/validators.py:443–456  ·  view source on GitHub ↗

A validator that performs deep validation of a dictionary. :param key_validator: Validator to apply to dictionary keys :param value_validator: Validator to apply to dictionary values :param mapping_validator: Validator to apply to top-level mapping attribute (optional)

(key_validator, value_validator, mapping_validator=None)

Source from the content-addressed store, hash-verified

441
442
443def deep_mapping(key_validator, value_validator, mapping_validator=None):
444 """
445 A validator that performs deep validation of a dictionary.
446
447 :param key_validator: Validator to apply to dictionary keys
448 :param value_validator: Validator to apply to dictionary values
449 :param mapping_validator: Validator to apply to top-level mapping
450 attribute (optional)
451
452 .. versionadded:: 19.1.0
453
454 :raises TypeError: if any sub-validators fail
455 """
456 return _DeepMapping(key_validator, value_validator, mapping_validator)
457
458
459@attrs(repr=False, frozen=True, slots=True)

Callers

nothing calls this directly

Calls 1

_DeepMappingClass · 0.85

Tested by

no test coverage detected