nucypher / zerodb

*This project is no longer actively maintained. If you'd like to become the maintainer, please let us know.* ZeroDB is an end-to-end encrypted database. Data can be stored and queried on untrusted database servers without ever exposing the encryption key. Clients can execute remote queries against the encrypted data without downloading all of it or suffering an excessive performance hit.
GNU Affero General Public License v3.0
1.56k stars 102 forks source link

python3.5 support #37

Closed micxjo closed 8 years ago

micxjo commented 8 years ago

Adds python3.5 support.

Most of the changes are pretty straightforward, though 5a06504 is a little subtle. Because of how tuples are compared, the last line of IndexQueue.optimize() requires Model's to be comparable, which is true in python2 because all classes have an implicit __cmp__(), but is not true in python3. I defined Model.__lt__() to reproduce the behavior under python3 but am not familiar enough with the codebase to know if this was wise. The comment in optimize() suggests that the sort is really about sorting by operation, in which case maybe we should be passing key=lambda x: x[0], removing the need for Model's to be comparable and for that matter removing the overhead of comparing them here (e.g. what if someone overrides __cmp__()/__lt__() on their Model subclass in a really slow way).

michwill commented 8 years ago

Wow, really impressive! You even caught that sortKey was contradicting the docstring in the interface!