-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add argument names to enum_ methods #2637
Conversation
@andioz, if you would want to have a look, and double-check if I didn't miss anything, please go ahead! :-) |
@YannickJadoul, thanks for the quick implementation! I tried the new code, it looks good. If I understand it right, this pull request changes the hard-coded argument names from You say this is no full solution, you mean there is still no method to customize the name, right? Well thats fine right now, good to have good default names. I would suggest to add all changed names to the changelog, and maybe mention it in the documentation? And finally, I would suggest to add piece of code to the tests, just to show the changed behavior. Good job 👍 |
Thanks, @andioz!
Those are the macros for all the comparison operators (
Yes, that's what I meant. After all, I agree
Is it that big/important? The changelog (see above) will point here anyway, and for the docs I'm not convinced this isn't just going to be "noise" (users would just notice in their docstring signatures; I'm not sure there's anything to explain about how this works?). |
Regarding documentation, I agree, it is not important enough. But a changelog entry should be there. And a short test ;) I've seen there are test for docstrings available. |
Yep, the changelog gets added afterwards; it's in the original message at the top of this PR (it gets added afterwards, to avoid too many merge conflicts). Tests could be possible. I also don't think it's that urgent for this kind of case, but it can't really hurt either, I suppose :-) |
OMG - you should write tests before changing code 😆 Well, just kidding, but seriously, I learned to find it really useful to write a test before changing code. Anyway, your choice. |
Hahaha, myeah, I know. But I'm too focused on fixing it, and especially in this case, it feels so immediate that ... yeah. When it gets complex, I do sometimes stash my own changes to see if tests failed before, though ;-) |
I'm fine with it :) So, do you think about closing the issue at all, even functions for customization are not available yet? With some rejection note? |
Well, yeah. It's kind of solved, no? I thought this was at least good enough, unless someone can come up with some great idea. Or don't you agree? |
Agreed and approved 👍 I close the issue, thanks Yannick |
No worries. This will automatically close that issue ;-) |
haha I'm not used to this github stuff, but I will learn |
Given this "Closes #2623" (or "Fixes") in the main description above, merging this PR will close that issue automatically. |
Oh a test! Great!! 👏 |
Not sure what else to test, so I'm going to call this done ;-) |
Sure, good test are often pretty simple, if the code base is clean. Thanks for all, great work! |
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.
This PR passed Google-global testing.
I strongly support merging now, so it ships with 2.6.1.
That's good enough for me. |
Description
Add generic names to the methods added by
enum_
, to avoid autogeneratedarg0
, etc. names.This is not a full solution to #2623, but I think it's the best we can easily do? Taking extra parameters seems reasonably over the top, and I can't immediately come up with a better solution. Suggestions welcome, though.
Closes #2623
Suggested changelog entry: