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
@korlaz doing msgspec.structs.asdict(User) isn't supposed to work, and it wouldn't work with a subclass of Struct either, as asdict only works on instances.
I've checked and asdict works as expected with StructMeta-based classes. Can you confirm this was just an error in your report, or are you actually facing another bug there?
Thanks for this quick PR ! Forget about my 2nd comment, there is no issue with msgspec.structs.asdict.
Was the issue msgspec.inspect.type_info(User)taken into account as well ?
Activity
korlaz commentedon Nov 17, 2025
Same thing for
msgspec.structs.asdict(User):Different output for
msgspec.inspect.type_info(User):With
StructMeta:Without:
provinzkraut commentedon Nov 22, 2025
@korlaz doing
msgspec.structs.asdict(User)isn't supposed to work, and it wouldn't work with a subclass ofStructeither, asasdictonly works on instances.I've checked and
asdictworks as expected withStructMeta-based classes. Can you confirm this was just an error in your report, or are you actually facing another bug there?korlaz commentedon Nov 22, 2025
Thanks for this quick PR ! Forget about my 2nd comment, there is no issue with
msgspec.structs.asdict.Was the issue
msgspec.inspect.type_info(User)taken into account as well ?provinzkraut commentedon Nov 22, 2025
Yes it was!
fix inspection for structs that use the `StructMeta` metaclass (#941) (…