-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-120376: operator.in_ & operator.not_in #120379
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
Misc/NEWS.d/next/Library/2024-06-12-01-12-19.gh-issue-120376.R0lyvC.rst
Outdated
Show resolved
Hide resolved
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.
LGTM. I just left a minor suggestion for the docstring.
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.
Haha, in fact, the function already exists: https://docs.python.org/dev/library/operator.html#operator.contains
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Yes, aware of it. See, https://discuss.python.org/t/proposed-additions-to-operator/49846/16 for why adding these is potentially is a good idea. |
@vstinner One last thing I can do to support this is to provide github use-case search result count:
And I have laid out my reasoning from personal experience in https://discuss.python.org/t/proposed-additions-to-operator/49846/16 providing a contrast with reversal of other functions. |
I have made the requested changes; please review again |
Thanks for making the requested changes! @vstinner: please review the changes made to this pull request. |
That's not how that works, you haven't changed anything. You can ask to consider the information though.
Ideally you would use this: |
I agree with Victor and the others who have commented on the Discourse thread that it's not worth it to add a function that is identical to I can see more of an argument for the |
Hmm, wouldn't it be better to add |
Personally, I would expect |
I suggest you close the issue and PR and create new ones for |
I agree, my motivation is based on a need and careful consideration. People are implementing And I have explained why it makes sense to me and what sort of functionality it supports. The fact these somewhat naturally fit in between |
I have re-evaluated and incorporated feedback as best as I could. So I wavered a bit on this one, but came back to my initial position. What made up my mind was the fact that Compare(
left=Name(id='a', ctx=Load()),
ops=[In()],
comparators=[
Name(id='b', ctx=Load())]))]) So they are generally useful utilities and also important functions for frameworks that build on
While |
I have made the requested changes; please review again |
Thanks for making the requested changes! @vstinner: please review the changes made to this pull request. |
Again: don't say that if you haven't changed anything. You're supposed to "have made the requested changes". If vstinner agrees with you after posting the new information, he'll drop his stale review. Otherwise you need to do what he told you to do. |
@AlexWaygood and I are against adding |
I just thought providing new perspectives / arguments and addressing criticism can have an impact. You kinda left me hanging there, I addressed criticism so I was expecting some response to why my reasoning doesn't cut it. And I didn't mean to ping you this way second time, I was just testing how things work as there was still "change requested" and I thought maybe it reappeared because I converted it to draft and then back. Anyway. Ok, closing this. Thank you for your time considering this. |
He didn't tell me to do anything. Generally, I am very confused by your interference. I don't need you explaining me the obvious. |
He told you implicitly:
If the function already exists (with different argument order), that means that it's not needed. (There should be one...)
I am confused as to why you stated you made changes when you didn't, that's all. I'm totally fine with you arguing about it to try to change our mind. |
I'm open to consider adding "not contains", but I'm not sure about the best name for that. But I don't think that we should add |
I have no interest in |
Ok. Thanks for your contribution anyway. I was close to merge your PR when I saw that |
No worries at all, maybe it is for the best. These 2 functions wouldn't solve the root of what is causing problems to me anyways. Maybe I will have some better ideas down the line. |
π Documentation preview π: https://cpython-previews--120379.org.readthedocs.build/