[MERGE] key-length GraphIndex adapter

John Arbash Meinel john at arbash-meinel.com
Tue Aug 14 17:22:49 BST 2007


John Arbash Meinel has voted approve.
Status is now: Approved
Comment:
If the point is to have key_count be a cheap call, isn't this:
+
+    def key_count(self):
+        """Return an estimate of the number of keys in this index.
+
+        For GraphIndexPrefixAdapter this is relatively expensive - key
+        iteration with the prefix is done.
+        """
+        return len(list(self.iter_all_entries()))

sort of against the point of having the function?

It seems like you would want key_count() to be tested across all indexes 
(as a index_implementations/ test), but as it is a 'fuzzy' value, I'm 
not sure how you would do this.

Overall, I think the code is good and merge worthy (once 0.91 opens up).

I do wonder if it is worth having Index implementations tests, though. 
Since we seem to be getting a lot of them, and they are expected to have 
the same interface.

For details, see: 
http://bundlebuggy.aaronbentley.com/request/%3C1186548521.30707.75.camel%40localhost.localdomain%3E



More information about the bazaar mailing list