This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: [RFC][2/5] Event and event registry
- From: Tom Tromey <tromey at redhat dot com>
- To: Oguz Kayral <oguzkayral at gmail dot com>
- Cc: archer at sourceware dot org
- Date: Mon, 21 Sep 2009 15:55:17 -0600
- Subject: Re: [RFC][2/5] Event and event registry
- References: <36a35d480908230835s661fdbc2r3844a95c212a8fb@mail.gmail.com>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Oguz" == Oguz Kayral <oguzkayral@gmail.com> writes:
Oguz> These two new files adds event registries and events to Python
Oguz> scripting. An event registry contains a list of callbacks to be
Oguz> fired when an event occurs.
Oguz> Py_INCREF (func);
Oguz> PyList_Append (callback_list, func);
I always forget whether the list APIs incref themselves, or not.
Oguz> /* Implementation of EventRegistry.disconnect () -> NULL */
Oguz> static PyObject *
Oguz> evregpy_disconnect (PyObject *self, PyObject *function)
[...]
Oguz> Py_INCREF (func);
Oguz> PySequence_DelItem (callback_list, PySequence_Index (callback_list, func));
I don't understand the need to incref here.
Oguz> An event object contains the details of an occured event (exit code,
Oguz> breakpoint number, stop reason etc.)
It seems to me that we could just define that an event is a dictionary,
rather than introducing a new type. Is there a drawback to doing this?
Tom