-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Implement astuple method #78
Conversation
Current coverage is 100% (diff: 100%)@@ master #78 diff @@
===================================
Files 8 8
Lines 446 466 +20
Methods 0 0
Messages 0 0
Branches 97 105 +8
===================================
+ Hits 446 466 +20
Misses 0 0
Partials 0 0
|
""" | ||
Tests for `asdict`. | ||
""" | ||
@given(st.sampled_from(IMMUTABLE_SEQ_TYPES)) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@hynek How do we feel about |
Also I'm thinking we need either a dict_factory parameter or to have retain_collection_types to apply to dicts too, since right now astuple will map all OrderedDicts to dicts and there should be a way to avoid that. I think just having |
I very much think that |
Yeah, let's leave it in. I was actually thinking about passwords in the first place. But the exact scenario I was worried about is impossible since no mandatory attributes are allowed after an attribute with a default value, so it's moot anyway. |
I took all your comments into account. |
called with the :class:`attr.Attribute` as the first argument and the | ||
value as the second argument. | ||
:param callable tuple_factory: A callable to produce tuples from. For | ||
example, to produce ordered tuples instead of normal Python tuples. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Alright, we're getting close for Hynek to take a look. :) |
I've noticed |
Expand the nested_class strategy. Test retain_collection_type in astu…
@hynek I think this is in good shape, please take a look when you have a chance. |
could you please activate the shiny new maintainer collaboration feature? I don’t want to pester you with minutiae. |
Done ! |
I guess this will need some work due to @Tinche’s work on simple_class? |
Yeah, this needs a slight rebase. |
Ok, I fixed it. |
Thank you! |
Please checkout my proposal #77. Do not hesitate to comment this code.
The parameter
tuple_factory
is only tested with thetuple
type. If you think this should be tested with other factories, do not hesitate to tell me.