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
Use attrs everywhere #44
Conversation
Unfortunately, the docstrings are gone... See * python-attrs/attrs#8 * python-attrs/attrs#357
"Generally speaking, the moment you think that you need finer control over how your class is instantiated than what attrs offers, it's usually best to use a classmethod factory or to apply the builder pattern." http://www.attrs.org/en/stable/init.html#post-init-hook
I also removed converters, which means that I broke the API and will probably have to replace them by classmethods, as advised in the attrs documentation:
|
Codecov Report
@@ Coverage Diff @@
## master #44 +/- ##
==========================================
+ Coverage 97.56% 98.98% +1.41%
==========================================
Files 12 12
Lines 1027 590 -437
==========================================
- Hits 1002 584 -418
+ Misses 25 6 -19
Continue to review full report at Codecov.
|
All tests are passing, so I'll go ahead and merge this. |
This already passes all the tests locally.
Things that will have to be reworked:
Things I removed and I'd like to bring back:
Things I'd like to review:
default=None
everywhere)isinstance
(we are inconsistently using positive and negative checks)__attrs_post_init__
but we could use@x.validator
instead http://www.attrs.org/en/stable/init.html#decorator)KNOWN_PROPERTIES
(can I iterate overattrs
properties now instead?)Things I'd like to add in the future: