[C++-sig] Delete objects, remove from dict

Simon W simwarg at gmail.com
Mon Oct 25 19:21:17 CEST 2010


Thanks that did the trick!

On Mon, Oct 25, 2010 at 7:07 PM, Ralf W. Grosse-Kunstleve <rwgk at yahoo.com>wrote:

> Oh, at second glance...
>
>
>
> > >             object obj = mMainNamespace[ name.c_str()  ];
> > >            obj.del();
>
> This cannot work!
> You need to do it the way I showed before.
>
> mMainNamespace[ name.c_str()  ].del();
>
> The [] operator returns a proxy object which supports the del since
> it still knows what the target object is. Once you've assigned the
> proxy object to boost::python::object the target information is lost.
>
> Ralf
> _______________________________________________
> Cplusplus-sig mailing list
> Cplusplus-sig at python.org
> http://mail.python.org/mailman/listinfo/cplusplus-sig
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20101025/760297fc/attachment-0001.html>


More information about the Cplusplus-sig mailing list