[Piglit] [PATCH] framework: Replace custom serialization format with json

Paul Berry stereotype441 at gmail.com
Wed Jul 13 13:47:17 PDT 2011

On 13 July 2011 12:32, Chad Versace <chad at chad-versace.us> wrote:
>> Minor nit-picks about make_tree's nested function get_subgroup():
>> 1. I think this function would make more sense as a regular member
>> function of GroupResult.
> Before addressing your point, allow me point out a typo in the method signature.
> ``def make_tree(self, tests)`` should be ``def make_tree(cls, tests)``.
> Observe that make_tree() never references self (or, after correction, cls). So, in
> this code,
>    g = GroupResult()
>    # Do stuff with g, perhaps add subgroups
>    h = g.make_tree(tests)
> h has no relation to g or any of its subgroups. To me, this indicates that make_tree()
> should not be a member function.

Agreed.  What I was trying to suggest was that get_subgroup() be a
member function, not make_tree().

BTW, since make_tree doesn't refer to cls, you probably want to
declare it using @staticmethod rather than @classmethod.  That way the
unused "cls" parameter will go away.

More information about the Piglit mailing list