-
-
Notifications
You must be signed in to change notification settings - Fork 387
Implement by_name #86
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
Conversation
Current coverage is 100% (diff: 100%)@@ master #86 diff @@
===================================
Files 8 8
Lines 443 446 +3
Methods 0 0
Messages 0 0
Branches 98 97 -1
===================================
+ Hits 443 446 +3
Misses 0 0
Partials 0 0
|
This sort-of fixes #82. |
A thought. What about instead of attrs_attrs being a tuple of Attributes, we make it an ordered dictionary of attribute names to attributes? It's an internal thing, and fields() can be changed to just return list(attrs_attrs.values()) or something. |
Or, since I'm brainstorming, a namedtuple. That might even give us a prettier API than the dict-like by_name. |
If it's a namedtuple, you could do both:
and
(Again, just brainstorming, it's too early for me :p) |
I kind of forgot, that the whole point of The irony of using |
The thought of using an However, I like the API a lot, so let me play around with it, implement it another way. |
As a replacement for C.attribute that doesn't work with __slots__ and is overall bad design.
As a replacement for C.attribute that doesn't work with slots and is
overall bad design.
I’ve also improved the overall exception situation (and its documentation). Comments anyone?