Generators through the C API

2009-07-30 Thread Lucas P Melo
Hello, I'm a total noob about the C API. Is there any way to create a generator function using the C API? I couldn't find anything like the 'yield' keyword in it. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Balanced binary tree implementation

2009-07-21 Thread Lucas P Melo
Hello, I would like to use a balanced binary tree implementation (preferably within some API). Any hints about where I could find it? I am looking for something that implements insertion, deletion, search and a special search that returns the lesser element bigger than a given key [1]. A n

Re: List insertion cost

2009-07-21 Thread Lucas P Melo
Robert Kern wrote: O(n). Python lists are contiguous arrays in memory, and everything after the insertion point needs to be moved. Raymond Hettinger has a good talk about the implementation of Python lists and other container objects. http://www.youtube.com/watch?v=hYUsssClE94 http://www.pyco

List insertion cost

2009-07-21 Thread Lucas P Melo
Hello, I would like to know how much it costs to insert an element into a list using this operation: a[2:2] = [ 1 ] i. e, what is the complexity of the operation above (given that len(a) = n)? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Tool for browsing python code

2009-06-16 Thread Lucas P Melo
Is there any tool for browsing python code? (I'm having a hard time trying to figure this out) Anything like cscope with vim would be great. -- http://mail.python.org/mailman/listinfo/python-list