MCPcopy Index your code
hub / github.com/msgspec/msgspec / test_decode_dec_hook

Function test_decode_dec_hook

tests/unit/test_yaml.py:169–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

167
168
169def test_decode_dec_hook():
170 def dec_hook(typ, val):
171 if typ is Decimal:
172 return Decimal(val)
173 raise TypeError
174
175 res = msgspec.yaml.decode("'1.5'", type=Decimal, dec_hook=dec_hook)
176 assert res == Decimal("1.5")

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…