Re: [Python.NET] PyTuple IDisposable implementation

Tony Roberts <[email protected]>
Newsgroups gmane.comp.python.dotnet
Message-ID <CA+Xbcsapt8R2gXkfAXyxJTto4PzDh2=K5iy9KM0L0kjnj=COYw@mail.gmail.com>
When the tuple is destroyed each of the members will have their reference
count decremented. The tuple 'steals' the references of the members when
it's constructed, hence why there's the call to Incref and no need for a
corresponding decref. This happens in the Python C API and so there's no
need to do anything in the C# code when the tuple is destroyed.

On Wed, Mar 30, 2016 at 8:38 PM Steven Burns <[email protected]>
wrote:

> I'm creating PyTuple instances using the constructor.
>
> I noticed the constructor calls Runtime.Incref for each of the tuple
> elements.
>
> But PyTuple doesn't override PyObject's implementation of IDisposable.
>
> It's not clear to me when this references will be cleared.
>
> Thanks,
>
> Steven
>
>
> _________________________________________________
> Python.NET mailing list - [email protected]
> https://mail.python.org/mailman/listinfo/pythondotnet

_________________________________________________
Python.NET mailing list - [email protected]
https://mail.python.org/mailman/listinfo/pythondotnet
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.