MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / values_equal

Function values_equal

sdks/python/tests/test_contract.py:72–78  ·  view source on GitHub ↗

Cross-type comparison (JSON number vs YAML int, bool, string).

(json_val: Any, yaml_val: Any)

Source from the content-addressed store, hash-verified

70
71
72def values_equal(json_val: Any, yaml_val: Any) -> bool:
73 """Cross-type comparison (JSON number vs YAML int, bool, string)."""
74 if isinstance(yaml_val, bool):
75 return json_val is yaml_val or json_val == yaml_val
76 if isinstance(yaml_val, (int, float)) and isinstance(json_val, (int, float)):
77 return json_val == yaml_val
78 return str(json_val) == str(yaml_val)
79
80
81# ── Scenario determination ────────────────────────────────────────

Callers 1

_exec_requestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected