Skip to content

[experiment] Validate Any at runtime for Cargo dataclasses#15936

Draft
bonzini wants to merge 5 commits into
mesonbuild:masterfrom
bonzini:cargo-typing-validate
Draft

[experiment] Validate Any at runtime for Cargo dataclasses#15936
bonzini wants to merge 5 commits into
mesonbuild:masterfrom
bonzini:cargo-typing-validate

Conversation

@bonzini

@bonzini bonzini commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

This is an experiment of checking at runtime whether the data stuffed into dataclasses by the Cargo interpreter has the right types.

The same approach could also be used to validate incoming TOML files.

Leaving as draft because it's an old prototype and I did nothing more than rebase it, but it may be interesting for inspiration.

bonzini added 4 commits June 19, 2026 13:55
These were added in Python 3.8.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
@bonzini bonzini added typing dependencies:cargo Issues related to using cargo subprojects labels Jun 19, 2026
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies:cargo Issues related to using cargo subprojects typing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant