Okay, the subject isn't very clear, but I found it hard to explain it in 
a concise and understandable fashion in a single sentence.

What I have are a set of classes that "wrap" access to C structs, and 
are created by handing them a pointer. (Either they take ownership of 
it, meaning they free it in __dealloc__, or they just borrow it, but 
that's beside the point)

What I want a way is to make sure that one pointer = one specific python 
object, so that trying to instantiate it again would return the same object.

What's a good way to do this? A module-level dict of pointer -> object, 
"memoizing" the python objects? Would access to such a dict be 
thread-safe, or do I need some kind of explicit locking?

-- 
Kindest regards, Jørgen P. Tjernø.
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to