Skip to content

Conversation

@alamb
Copy link

@alamb alamb commented Jul 14, 2025

This PR targets the following from @friendlymatthew

The high level idea is to handle the low level recursion in ValueBuffer in a uniform way

Then the higher level VariantBuilders simply call into that

I ran out of time today, but I think this approach is pretty promising

}

fn append_variant<'m, 'd>(&mut self, variant: Variant<'m, 'd>) {
fn new_object<'a>(&'a mut self, metadata_builder: &'a mut MetadataBuilder) -> ObjectBuilder<'a> {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the major change - move the low level appending to the ValueBuffer itself

Then all the recursion seems to fall into place

Copy link
Member

@friendlymatthew friendlymatthew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I will take a look

@friendlymatthew friendlymatthew merged this pull request into pydantic:friendlymatthew/append-complex Jul 14, 2025
10 of 12 checks passed
friendlymatthew added a commit that referenced this pull request Jul 14, 2025
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.

2 participants