-
Notifications
You must be signed in to change notification settings - Fork 778
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
Added eq
, ne
, gt
etc. methods.
#2175
Conversation
friendlier to beginners. Closes #2155.
Thanks! Can you add tests for these? 😃 Also, I'm not sure about the names for these. I'm tempted to go with |
Also needs an entry in the changelog, please. |
@mejrs sure, I'd be happy to add tests. I tried to find where |
@mejrs Should I add the tests as documentation tests? |
I would recommend adding a new test at the bottom of the file where you create a vec with a bunch of different python objects and loop through every possible pair against every compare op, and check whether they give the expected results. That is probably a bit much for a doc example 😉 |
Thanks! Regular tests would be better than doctests please; we don't measure coverage for doctests yet.
The only thing that makes me uneasy about that is that then |
Oh, that is unfortunate. But having In hindsight it may have been better to not have the PartialEq impls and have a |
Yeah I agree that The question is, can this have further repercussions than an easy-to-fix compile error? If we're not currently also providing |
I would be happy to remove the current |
I've thought about it some more and I really don't like the PartialEq either. So, I think the plan is?
|
We may want to mention the removal in the migration guide, just in case it causes any surprises for users. (Given it's not possible to deprecate a trait implementation as far as I know.) |
I did the PartialEq related stuff in #2183, so this PR just needs some tests and changelog entry to be ready. |
Please let me know if you think the tests are done right, I'm not sure that Rust's |
is_eq
, is_ne
, is_gt
etc. methods.eq
, ne
, gt
etc. methods.
I wonder if we shouldn't go one step further here and do the I know that richcmp methods can return anything, but that is already quite esoteric, and usability here will be much better if only one Those who need the general result can still use |
I would support that. |
Done. |
I think it's ready. Please review it. |
I think this is good to go. Don't know how the coverage could go down, all methods are tested. |
Codecov seems to do this weird thing where any PRs with the originating fork branch as |
I also saw that, since rustfmt split the |
True, yes! Perhaps the upstream macro expansion should consider having the |
This is done for convenience and to be friendlier to beginners.
Closes #2155.