|
Re: how to obtain a (python) object's __name__ special attribute: msg#00262python.c++
--- Stefan Seefeld <seefeld@xxxxxxxxxxxx> wrote: > I'v successfully read in a derived class definition from a python script > into my C++ application, and I have instantiated it. How can I now determine > the 'type name' of the object ? I try attr("__name__") but it appears > the __name__ attribute isn't visible as an ordinary attribute, i.e. this > call raises an exception. The object should have __class__, which should have a __name__: >>> l = list() >>> l.__class__.__name__ 'list' >>> l.__name__ Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'list' object has no attribute '__name__' >>> Could this be your problem? Ralf __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Converting CString to/from std::string: 00262, Ralf W. Grosse-Kunstleve |
|---|---|
| Next by Date: | Re: Recent changes to FAQ: 00262, David Abrahams |
| Previous by Thread: | how to obtain a (python) object's __name__ special attributei: 00262, Stefan Seefeld |
| Next by Thread: | set_wrapper: 00262, Giulio Eulisse |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |