MCPcopy
hub / github.com/scrapy/scrapy / _validate_values

Function _validate_values

scrapy/utils/conf.py:52–59  ·  view source on GitHub ↗

Fail if a value in the components dict is not a real number or None.

(compdict: Mapping[Any, Any])

Source from the content-addressed store, hash-verified

50 return {convert(k): v for k, v in compdict.items()}
51
52 def _validate_values(compdict: Mapping[Any, Any]) -> None:
53 """Fail if a value in the components dict is not a real number or None."""
54 for name, value in compdict.items():
55 if value is not None and not isinstance(value, numbers.Real):
56 raise ValueError(
57 f"Invalid value {value} for component {name}, "
58 "please provide a real number or None instead"
59 )
60
61 _validate_values(compdict)
62 compdict = without_none_values(_map_keys(compdict))

Callers 1

build_component_listFunction · 0.85

Calls 1

itemsMethod · 0.80

Tested by

no test coverage detected