-
Notifications
You must be signed in to change notification settings - Fork 139
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
Index#dup should copy reference to name too #477
Conversation
ping @v0dro |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for noting this point.
I think
This should return false, WDYT? update I think we should have |
This PR looks good to fix the issue mentioned above. But it came up another question : Mentioned in above comment. |
I will wait for 24 hours for any other comments. If fine then I will go ahead and merge. |
@Shekharrajak Hi, thanks for the feedback. The problem fixed by this PR and the concern brought by your comment is, IMHO, a separate concern, so I'd be glad if you go ahead and merge this. The concern you brought up, although I, myself, haven't encountered such a case where I need to compare the Daru objects based on the content of its data, I can agree that such method will be useful. About the naming of such method, I disagree with naming the method as
If such a method is needed, I'd recommend using a name which does not conflict with the ruby's equality methods. For example, how about |
@Yuki-Inoue , yes we need to discuss about my concern in different issue ticket (Ruby doc about ==, eq ,equal ) and it is different from this PR.
This PR is in. |
Currently, if
idx.instance_of?(Daru::Index)
, then following statement does not hold:This is because name is not copied on
Daru::Index#dup
, which I think is not the expected behavior at least to the library user.So, this PR fixes it.