-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
document and validate link, dlink #7468
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
|
Thanks for the heads up. I think it is fine for me. (PS: is having the same name really an issue?) |
|
@ellisonbg lost time to the confusion, so I think it makes sense to me to separate them. I don't have enough experience with it to have an opinion on the matter. |
|
Fine with me to. |
|
Hmm right now we have:
I think they have the same APIs as each other. I propose that we make these two APIs completely parallel in structure and naming. Some options:
In either case, we need to add docstrings to the widget versions of whatever survives. Pinging @jdfreder who will return tomorrow for input. |
|
@ellisonbg interesting, that sounds like the opposite of what you described in #7410. I thought the issue was that they had the same names, but weren't the same thing. But now that sounds like exactly what you want to happen - identical names for two different things. |
|
Sorry about the confusion language:
I am trying to find names that reflect that they have the same API (other On Thu, Jan 15, 2015 at 2:43 PM, Min RK notifications@github.com wrote:
Brian E. Granger |
|
ok, I'll wait for resolution on that |
|
I see why this could be confusing. I think they should either share the same names, I prefer |
|
Additionally, the widget classes themselve should probably have long names, |
|
@jdfreder and i will sit down and try to come up with good names. |
|
Great. I can implement whatever you decide here, or you guys can make your own PR, if that would be easier. |
|
I've added docstrings and argument validation, which should reduce the confusion. You use link, dlink exactly the same: link((obj, 'trait_name'), (obj, 'trait_name'), *etc)The difference is that |
|
@ellisonbg are you happy with Min's proposal, or do you still think those functions need renaming? |
|
I do think they should have truly different names because of the strong On Mon, Jan 26, 2015 at 2:57 PM, Thomas Kluyver notifications@github.com
Brian E. Granger |
|
Is there a strong chance they'll be imported at the same time? It seems to be like you'd use one or the other, but not a combination of both. Also, like @SylvainCorlay says "names spaces are one honking great idea". Isn't Python's |
|
Here is what I did: And I ended up with the widget link without knowing it...I agree that On Mon, Jan 26, 2015 at 4:14 PM, Jonathan Frederic <notifications@github.com
Brian E. Granger |
|
(GitHub related) Strange that your verbatim block isn't getting parsed by GFM correctly... |
|
Hmm, I sent that comment from email. On Mon, Jan 26, 2015 at 5:17 PM, Jonathan Frederic <notifications@github.com
Brian E. Granger |
|
@github there's a bug in GFM parsing 3 comments above this one. |
|
@ellisonbg an important change here - If you try to use widgets.link as if it's traitlets.link, there should be only two cases after this PR:
In case 1, the link should work fine. In case 2, it will fail immediately with an informative TypeError that only Widget sync traits can be linked. I think this type checking is the important improvement in this PR. If you still think the names shouldn't match, I'm happy to add a I would add a comment that due to exactly this hazard, if avoiding |
only functions are part of the public API
|
Per @ellisonbg's comments, js link functions are renamed
The classes are implementation details, and removed from the public |
|
Test failure was sporadic, which earned Travis a good kick in the rear. Success should be up soon. |
|
I'm happy with those names. @ellisonbg do you like the names @minrk is using now, jslink and jsdlink ? |
|
Yep, sounds good. |
|
It seems like everyone is happy with this. I'll merge in an hour or two unless anyone objects. |
document and validate link, dlink
These are just wrapper functions that return the classes.
The names collide with link, dlink in traitlets.
Use Link, DirectionalLink widget classes, instead.
closes #7410
In #7410 @ellisonbg also proposed renaming to jslink (and presumably jsdlink), so we could go that way.
ping @ellisonbg, @jasongrout, @SylvainCorlay