-
-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify code for generation of struct deserializers #2444
Conversation
…_struct_visitor`
…in both cases When !cattrs.has_flatten() all fields is !field.attrs.flatten() Co-authored-by: Oliver Schneider <[email protected]>
…is same in both arms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is a great cleanup. And thanks Oli for the review.
#2444 looks good (modulo a comment). It is a pure refactoring in well-reviewable individual commits. I checked that it does not change behaviour. The main part that needs your review is the actual change (moving from multiple somewhat connected boolish or option arguments to a single enum that separates all the different cases into explicit variants)
The first 7 commits of this PR eliminates various duplications from the code, making it more easely to understand, as I hope.
The last 3 commits makes more obvious which code is generated for different combinations of arguments. Because not all combinations are possible, after the changes impossible variants are not representable in the code.