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 BTrees allow some unorderable types #52

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

C BTrees allow some unorderable types #52

jamadden opened this issue Nov 20, 2016 · 0 comments

Comments

@jamadden
Copy link
Member

jamadden commented Nov 20, 2016

Given this class:

class Bad(object):
    def __eq__(self, other):
        return False

Under Python 2.7, you can use instances of this class as a key in any size C BTree.

Under Python 3, you can insert this into an empty tree only. Once you do, the tree is broken. Jim Fulton suggested that the key should be compared to itself on an empty tree to catch this (but given that pointer equality is checked first, it's not clear exactly how that would be done).

The Python implementation rejects this object in all versions in all size trees.

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

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