Skip to content
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

PIDStatus comparator is buggy #112

Open
krzysztof opened this issue Jan 15, 2018 · 0 comments
Open

PIDStatus comparator is buggy #112

krzysztof opened this issue Jan 15, 2018 · 0 comments

Comments

@krzysztof
Copy link
Member

krzysztof commented Jan 15, 2018

since __neq__ is not overloaded, the following un-intuitive behaviour happens:

from invenio_pidstore.models import PIDStatus
PIDStatus.NEW == 'N'  # Returns True (expected)
PIDStatus.NEW == 'K'  # Returns False (expected)
PIDStatus.NEW != 'N'  # Returns True (bug)

Not sure if we should overload __neq__ or simply remove the equality comparator and always compare objects instead of their values, because as expected: PIDStatus.NEW != PIDStatus.NEW

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant