binding: make the pending_events functionality nicer[tm]