-
Notifications
You must be signed in to change notification settings - Fork 252
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
Equality operator not implemented on Requirement #325
Comments
There's no comparison operator implemented on the class, so this may be on purpose. What's your specific use-case for wanting this? I ask because without a concrete version specifier of what's installed this is a very ephemeral thing. And as a work-around, you could compare the string representations of the objects. |
I was trying to do this in a test and was wondering why it doesn't have it implemented. I ended up working it around with the string comparison, just like you suggested. I opened the issue mainly to clarify if this is an omission or if there is a good reason for not having it implemented. I don't have a strong opinion here. My only data point is that 'pkg_resources.Requirement' implements it, but I'm not even sure it's a goal at all to attempt any sort of compatibility with it. |
I don't know the history of the module to know if compatibility is in any way a goal. |
I also stumbled on this requirement in a testing context. It would be nice to have. |
Comparison will require normalization of Also, considering that variable P.S. I am in no way related to PyPA, so these are just my two cents. |
I was about to roll my sleeves up and implement this, when I saw that it has already been implemented in #499. As a result of this:
And specifically, the motivating reproducer in the issues description is also working:
Therefore, suggest this can be closed. |
Reproducer:
Is this expected behaviour?
The text was updated successfully, but these errors were encountered: