-
Notifications
You must be signed in to change notification settings - Fork 22
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
Decide API for setproperties and constructorof #1
Conversation
I'd say In general, I think it'd be better for ConstructionBase to aim for compositionality rather than end-user convenience.
I suppose ConstructionBase's API surface would be small and not overlap with Base? So, I think exporting all public API is a good baseline policy.
Hmm... That's kind of make sense. But maybe we are not going to have Another naming bikeshed is whether or not we should use constructor = constructor_of(T) As for
...so is |
Ref: Underscore audit JuliaLang/julia#20402 (comment) For example, it looks like |
I like We should export it for sure. |
OK. Considering there are many |
About
I think that is an excellent design guideline. So lets go with It was brought up to move |
I think it's a good point that downstreams might want keyword arguments variant. So I guess defining it here makes sense, provided that it is documented as call-only API; i.e., type authors should overload
Good point. Actually, I started think that bringing
|
Ok should these two setproperties(obj::MyType, patch)
setproperties(obj::MyType; kwargs...) have the same name or maybe call the one |
|
So lets leave |
Summary so far:
Does that sound good? Any other API issues about these two functions? |
Thanks a lot for initiating this repo! LGTM |
Codecov Report
@@ Coverage Diff @@
## master #1 +/- ##
=========================================
Coverage ? 92.85%
=========================================
Files ? 1
Lines ? 14
Branches ? 0
=========================================
Hits ? 13
Misses ? 1
Partials ? 0
Continue to review full report at Codecov.
|
Thanks for setting up travis + codecov! |
@tkf @rafaqz some API questions:
setproperties
? Currently it issetproperties(obj, patch)
. But maybesetproperties(obj; kw...)
is more convenient?constructor_of
? Shall we rename it into e.g.positional_constructor
?