Dmitry Chichkov added the comment:

Use case: a custom immutable array with a large number of items and indirect 
key field access. For example ctypes.array, memoryview or ctypes.pointer or any 
other custom container.


1. I'm not sure how anyone can consider a precached key array as a right ans 
scalable answer. It is just a ridiculuos idea. Precashing key array is a O(N) 
operation.  While bisect is O(log(N)).

2. @Raymond There is a statement that "adding 'key()' would encourage bad 
design and steer people after from better solutions."  Well, right now, the 
design that is being encouraged results in O(N) code. Because lazy developers 
are just 'pre-cacaching' (copying) the keys!

3. There is a statement that key() have to be called multiple times per item. 
What?  Why?

4. There is a statement that one can always add a _cmp_ function to an object. 
This is ridiculuous. The object could be immutable. There should be no need to 
modify the object/array when all that you need to do is to bisect it.

----------
nosy: +dmtr

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue4356>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to