[Xcb] [PATCH libxcb 10/18] c_client.py: use pattern matching with enumerate()

Christian Linhart chris at DemoRecorder.com
Sun Mar 15 03:44:12 PDT 2015


Hi Ran,

Can you please update your patch according to the comments of Rémi?

Thank you,

Chris

P.S.: If you don't have time, please tell me and I'll make a modified patch.

On 10/12/14 22:40, Rémi Cardona wrote:
> Le 12/10/2014 20:58, Ran Benita a écrit :
>> @@ -483,8 +483,7 @@ def _c_helper_resolve_field_names (prefix):
>>      all_fields = {}
>>      tmp_prefix = []
>>      # look for fields in the remaining containers
>> -    for idx, p in enumerate(prefix):
>> -        name, sep, obj = p
>> +    for (idx, (name, sep, obj)) in enumerate(prefix):
> The outer parenthesis can be dropped.
>
>> @@ -833,7 +832,7 @@ def _c_serialize_helper_fields_fixed_size(context, self, field,
>>      if not self.is_case_or_bitcase:
>>          code_lines.append('%s    /* %s.%s */' % (space, self.c_type, field.c_field_name))
>>      else:
>> -        scoped_name = [p[2].c_type if idx==0 else p[0] for idx, p in enumerate(prefix)]
>> +        scoped_name = [obj.c_type if idx==0 else name for idx, (name, sep, obj) in enumerate(prefix)]
> sep is unused, use _ instead (just like you did in the following chunk).
>
> Patch looks otherwise good.
>
> Rémi
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb
>



More information about the Xcb mailing list