Jason Biggs


On Fri, Aug 28, 2020 at 8:16 PM dmaziuk via Rdkit-discuss <
rdkit-discuss@lists.sourceforge.net> wrote:

> On 8/27/2020 8:48 PM, Jason Biggs wrote:
> >
> > I'm not very familiar with how the python interface works, is there a
> > similar issue with the python wrappers?  Does the wrapper class for the
> > Atom clean up after itself differently if the atom is marked as having an
> > owner?
>
> There Be Dragons.
>
> Python VM does reference counting on its own objects and will destroy
> them for you at some point. Exactly how it works out with objects
> created by external libraries is an interesting question.
>
> SWIG, for example, creates a "proxy" python object for each c++ one,
> with a flag that tells the runtime to either destroy the underlying c++
> object when the "proxy" is garbage-collected, or not. E.g. if you
> garbage-collect an Atom on python side, you have no idea if destroying
> its linked c++ Atom will mess up its c++ ROMol container, so on
> container/element-type objects the flag's typically a "not".
>

This is helpful, thank you.  If I do end up exposing the Atom in top level
(mathematica in my case), then I will need to do something similar with the
wrapper class.

Jason


>
> Dima
>
>
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to