....and I had to Py_INCREF(memo)! Thank you A LOT!

On Mon, 31 Jan 2022 at 23:01, Chris Angelico <ros...@gmail.com> wrote:

> On Tue, 1 Feb 2022 at 08:54, Marco Sulla <marco.sulla.pyt...@gmail.com>
> wrote:
> >     PyObject* d = PyDict_New();
> >     args = PyTuple_New(2);
> >     PyTuple_SET_ITEM(args, 0, d);
> >     PyTuple_SET_ITEM(args, 1, memo);
> >     Py_DECREF(d);
> >
>
> https://docs.python.org/3/c-api/tuple.html#c.PyTuple_SET_ITEM
>
> SET_ITEM steals a reference, so you'll need to not also decref the
> dict yourself.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to