Eric Blake <ebl...@redhat.com> writes:

> Rather than having two separate visitor callbacks with items
> already broken out, pass the actual QAPISchemaObjectType object
> to the visitor.  This lets the visitor access things like
> type.is_implicit() without needing another parameter, resolving
> a TODO from previous patches.
>
> For convenience and consistency, the 'name' and 'info' parameters
> are still provided, even though they are now redundant with
> 'typ.name' and 'typ.info'.
>
> Signed-off-by: Eric Blake <ebl...@redhat.com>

We've seen this one before :)

The previous review is relevant:
Message-ID: <878u0hn08l....@dusky.pond.sub.org>
http://lists.nongnu.org/archive/html/qemu-devel/2016-04/msg02151.html

Quote its recap of pros and cons:

* The existing interface

      def visit_object_type(self, name, info, base, members, variants):
      def visit_object_type_flat(self, name, info, members, variants):

  is explicit and narrow, but when you need more information, you have
  to add parameters or functions.

* The new interface

     def visit_object_type(self, name, info, typ):

  avoids that, but now its users can access everything.

End quote.  Let's see how this series profits from the patch, and
whether we want to change the other visit methods as well for
consistency.

Reply via email to