On Fri, Sep 17, 2021 at 8:36 AM Hanna Reitz <hreitz@redhat.com> wrote:
On 17.09.21 07:40, John Snow wrote:
> This serves two purposes:
>
> (1) It is now possible to discern whether or not clear() removed any
> event(s) from the queue with absolute certainty, and
>
> (2) It is now very easy to get a List of all pending events in one
> chunk, which is useful for the sync bridge.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>   python/qemu/aqmp/events.py | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)

Not sure if `clear` is an ideal name then, but `drain` sounds like
something that would block, and `drop` is really much different from
`clear`.  Also, doesn’t matter, having Collection.delete return the
deleted element is a common thing in any language’s standard library, so
why not have `clear` do the same.


It isn't too late to change the name, but it sounds like you don't necessarily prefer any of those others over what's there now.
 
Reviewed-by: Hanna Reitz <hreitz@redhat.com>


Thanks!