-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
fix structure for union of attr classes with default values #108
Conversation
I was trying to fix broken tests - but because I'm not familiar with a hypothesis I failed. was assuming:
should fix the test - but it didn't work 😿 |
Hello, the test is failing because the new implementation is faulty :) This throws an error on master, but not on your branch:
Just because |
Here's a patch that does what you want:
Also please add a line to the changelog with a link back here. |
Codecov Report
@@ Coverage Diff @@
## master #108 +/- ##
==========================================
+ Coverage 97.70% 97.72% +0.02%
==========================================
Files 7 7
Lines 435 440 +5
==========================================
+ Hits 425 430 +5
Misses 10 10
Continue to review full report at Codecov.
|
@Tinche I think it's ready to review. (Autoreview in this case :P) |
@dswistowski I caught a cold, will review soon-ish :) |
Looks good, thanks! |
- See python-attrs/cattrs#108 for breaking PR
Structure union of attr classes when one of the fields was optional and had a default value was not deterministic.
Disambiguator function sometimes was created to use field with default value - and because it's allowed to not provide this value to
__init__
method wrong class was chosen to structure.A provided test case is a minimal deterministic test I was able to generate.