Embedding: Howto get object's dictonary

Fredrik Lundh fredrik at pythonware.com
Wed Oct 13 09:25:32 CEST 2004


Oliver Eichler wrote:

> having a PyObject pointer to a python object, how can I get the object's
> dictionary, if there is any. There seems to be _PyObject_GetDictPtr() but
> this looks quite like a internal "you must not use it".

I'd say it's more of an "be very careful", along the lines of _PyString_Resize,
_PyTuple_Resize, and other functions that can cause all sorts of trouble if you
use them carelessly.

(note btw that the function returns a pointer to the dictionary pointer, not the
dictionary itself)

</F> 






More information about the Python-list mailing list