How does tuple or list compare speed wise with dict? Ultimately I have
to hash into
my list using size information.
This also still does not address my confusion with regards to how to
capture a python object
before it get's destroyed. I can't do it in __dealloc__() as I
mentioned earlier since no ref count
increment will save the self object there.
I guess I could put it in the hash when I first create it, but I
would need some logic that prevents it being
allocated while it is still alive. Hmm that's no good because the ref
count would never go to zero and it
creates a defacto memory leak.
I still can't figure out how to do this without creating a container
class that holds the attributes of the class object
I'm trying to hash.
-Matt
---------------------------
Sturla Molden
Wed, 06 Jan 2010 05:46:50 -0800
And, in case the array size needs to be determined at runtime, why not
just
use a regular Python tuple?
I agree. It seems array lookup is not the bottleneck here, but object
creation. He should just store a container on module scope. I would have
used a Python list as it is mutable.
cdef list myhash = [extclass() for n in range(bufsize)]
S.M.
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev