You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
Oops, the TypeError there is incorrect (will fix). You should raise a NotImplementedError if the type is unsupported, and raise a TypeError/ValueError if the value doesn't match that type.
Question
There seems to be a (deliberate?) inconsistency in the docs regarding what exception
dec_hook
should raise if the expected messagetype
is unsupported.json.decode
states thatTypeError
should be raised.All other instances state that
NotImplementedError
should be raised.Can you clarify which is correct?
dec_hook
should raiseTypeError
for unsupported typesdec_hook
should raiseNotImplementedError
for unsupported typesdec_hook
should raiseNotImplementedError
for unsupported types, unless it is being passed tomsgspec.json.decode
when it should raiseTypeError
.The text was updated successfully, but these errors were encountered: