Skip to content

Conversation

@mishamsk
Copy link

Hi,

This is a very rough draft, opening to see if @jcrist will be open for this feature/approach.

It addresses #656 and my own #541 - allowing to decode data representing a tagged struct subclass in place of the super class.

This feature prevents me from switching to msgspec in my ast library, but should be generally very usable for any tree-like structure/messages.

As of time of writing, in order for this PR to be complete, at least the following has to be handled:

  • Wire the new allow_tagged_struct_subtypes kwarg into json, msg pack decoders
  • Properly handle type node / struct info caching. As of now, cache doesn't account for allow_tagged_struct_subtypes, so it will not honor the flag after decoder (type node) is cached for the first time
  • Add more tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant