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
I made a comment on a closed issue (#568) and I'm not sure it got any visibility so I'm creating a new one instead.
Here's a copy-pasta of my comment:
I got a chance to look at the fix (#602) and the corresponding tests. I copied your test below and made Custom inherit msgspec.Struct. Encoding still works but now decoding throws the following error
msgspec.ValidationError: Expected `object`, got `str` - at `key` in `$`
This is the code I used to generate the error (taken from your tests)
Is this expected behavior? Would it be difficult to support msgspec Structs as dictionary keys?
Another thing I found is using msgspec.*.decode(dec_hook=..., type=Dict[TypeVar('A') TypeVar('B')] did not work for me. Namely I wrote a stub dec_hook function that printed 'hello world' and it never triggered on decoding.
Maybe I was doing something wrong, but was wondering if this is supported at all.
The text was updated successfully, but these errors were encountered:
Question
I made a comment on a closed issue (#568) and I'm not sure it got any visibility so I'm creating a new one instead.
Here's a copy-pasta of my comment:
I got a chance to look at the fix (#602) and the corresponding tests. I copied your test below and made Custom inherit
msgspec.Struct
. Encoding still works but now decoding throws the following errorThis is the code I used to generate the error (taken from your tests)
Is this expected behavior? Would it be difficult to support msgspec Structs as dictionary keys?
Another thing I found is using
msgspec.*.decode(dec_hook=..., type=Dict[TypeVar('A') TypeVar('B')]
did not work for me. Namely I wrote a stubdec_hook
function that printed 'hello world' and it never triggered on decoding.Maybe I was doing something wrong, but was wondering if this is supported at all.
The text was updated successfully, but these errors were encountered: