[Python-3000] PEPs update (original) (raw)
Daniel Stutzbach daniel at stutzbachenterprises.com
Fri May 11 22:20:28 CEST 2007
- Previous message: [Python-3000] PEPs update
- Next message: [Python-3000] PEPs update
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 5/11/07, Raymond Hettinger <python at rcn.com> wrote:
Newly developed code always faces an uphill battle when compared to mature open-source.
As it should. :-)
End-users (everyday Python programmers) need to be understand the performance intuitively and have a clear understanding of what is going on under-the-hood. Our existing data structures have the virtue of having a simple mental model (except for aspects of re-sizing and over-allocation which are a bit obscure).
I guess I have a different perspective. One advantage of the BList is that the user doesn't need to understand what's going on under-the-hood. They can rely on it to have good performance for any operation.
One of my motivations in creating it was so I could be more lazy in the future. With a BList, I don't have to wonder whether Python code I write will ever be called with a really big list, and, if so, whether I need to rewrite my algorithm to avoid O(n^2) behavior.
That would likely be an informative exercise and would assure that your code is truly interchangable with regular lists. It would also highlight the under-the-hood difficulties you'll encounter with the C-API.
That being said, it is a labor intensive exercise and the time might be better spent on tweaking the third-party module code and building a happy user-base.
I actually don't think it will be that bad, since list operations go through one thin API. I just need to redirect the API in listobject.h and I'm mostly done. I think.
Maybe I'll take a quick pass at it, and if it turns into a nightmare, I'll reconsider.
> Indeed, I wrote the BList because there were idioms that I > wanted to use that were just not practical with an array-based list.
We ought to set up a page on the wiki for success stories with blist as a third-party module. In time, the Right Answer (tm) will become self-evident.
I haven't used the python.org wiki before. If you point me to the right place put a link to a BList page, I'd be happy to create one. Somewhere under UsefulModules?
-- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC
- Previous message: [Python-3000] PEPs update
- Next message: [Python-3000] PEPs update
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]