|
Re: Re: accessing the python type system: msg#00336python.c++
Hi David, David Abrahams wrote: which means you would be able to hold a boost::python::type 'type(x)' is a python expression, right ? The equivalent in C is PyObject *the_type = PyObject_Type(the_object); so your statement seems to imply that there already is some C++ wrapper code encapsulating a call to PyObject_Type, and resulting in some class' copy constructor to be called. Where can I find that ? I was assuming that the C++ API would provide a function somewhat similar to object type(const object &o) { return object(borrowed(PyObject_Type(o.ptr()))); } or, with a suitable 'type' class defined, type get_type(const object &o) { return type(borrowed(PyObject_Type(o.ptr()))); } in which case there is no copy constructor anywhere. Or in diagram form: the actual python objects (of type 'PyObject'). print 'class:',type(x) fine, the last line tells me that the 'metametaclass' is a 'type'. Applying the 'type' operator to that still returns 'type'. It's just one level higher up than what I described. So what ? All I was trying to get at is that a way to look at this is as a single rooted tree, where each parent node is the 'metaclass' of its respective child nodes. What am I missing ? Ok, still trying...;-) Regards, Stefan |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Re: Projects Page Reminder: 00336, Nicodemus |
|---|---|
| Next by Date: | embedding: getting exception information?: 00336, Achim Domma \(ProCoders\) |
| Previous by Thread: | Re: accessing the python type systemi: 00336, David Abrahams |
| Next by Thread: | Re: accessing the python type system: 00336, David Abrahams |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |