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

C/Py difference: keys that are the same object #50

Closed
jamadden opened this issue Nov 20, 2016 · 0 comments
Closed

C/Py difference: keys that are the same object #50

jamadden opened this issue Nov 20, 2016 · 0 comments

Comments

@jamadden
Copy link
Member

jamadden commented Nov 20, 2016

The C implementation does a comparison by first checking whether the two keys are the same pointer; the Python implementation just goes right to the == operator. In some cases of (broken?) objects this leads to a discrepancy: The C implementation can find a key, but the Python implementation cannot.

I would suggest that the Python implementation should use k is key or k == key to clear this up.

See https://groups.google.com/forum/#!topic/zodb/xhVM0ejl6aE

jamadden added a commit that referenced this issue Dec 22, 2016
Check key identity before ==. This matches the C implementation.
Fixes #50

Add a pickle test to the work done in #54. Fixes #51. Fixes #53 (for
Python 2).
jamadden added a commit that referenced this issue Dec 22, 2016
Check key identity before ==. This matches the C implementation.
Fixes #50

Add a pickle test to the work done in #54. Fixes #51. Fixes #53 (for
Python 2).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant