Question
There seems to be a (deliberate?) inconsistency in the docs regarding what exception dec_hook should raise if the expected message type is unsupported.
json.decode states that TypeError should be raised.
All other instances state that NotImplementedError should be raised.
Can you clarify which is correct?
dec_hook should raise TypeError for unsupported types
dec_hook should raise NotImplementedError for unsupported types
dec_hook should raise NotImplementedError for unsupported types, unless it is being passed to msgspec.json.decode when it should raise TypeError.
- other?
Question
There seems to be a (deliberate?) inconsistency in the docs regarding what exception
dec_hookshould raise if the expected messagetypeis unsupported.json.decodestates thatTypeErrorshould be raised.All other instances state that
NotImplementedErrorshould be raised.Can you clarify which is correct?
dec_hookshould raiseTypeErrorfor unsupported typesdec_hookshould raiseNotImplementedErrorfor unsupported typesdec_hookshould raiseNotImplementedErrorfor unsupported types, unless it is being passed tomsgspec.json.decodewhen it should raiseTypeError.