This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][2/5] Event and event registry


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]