Dag Sverre Seljebotn, 09.10.2010 16:22:
> it is not
> completely unimaginable that < on pointers can have a use in some algorithm.

There is a good example in libxml2. For a string interning hash table, it 
allocates string memory in larger blocks and appends strings to it as long 
as they fit into an existing block. That way, checking whether a key is 
owned (i.e. memory managed) by the hash table can be done quickly by 
comparing its start pointer to the memory bounds, rather than (expensively) 
calculating the hash key, looking it up and comparing the pointers with "==".

So there are legitimate use cases for > and < pointer comparisons. I'm just 
suggesting that for string values, it's a lot more common to compare the 
strings than the pointers. I think that Cython's semantics should reflect 
that, as long as there's a usable (i.e. simple enough) way to get the 
alternative behaviour.

I totally agree that such a change is worth noting in the release notes.

Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to