[Freeipa-devel] [PATCH 0021] Forbid overlapping rid ranges for the same id range

Petr Viktorin pviktori at redhat.com
Thu Dec 13 08:48:41 UTC 2012


On 12/12/2012 04:32 PM, Martin Kosek wrote:
[...]
> 2) I don't like this construct very much:
>
> updated_values = dict(zip(rid_range_attributes,[None]*3))
>
> This would look better, IMO:
> updated_values = dict((attr, None) for attr in rid_range_attributes)

Or just `dict.fromkeys(rid_range_attributes)` (but see below)

> Why do you need this dict pre-created anyway? You overwrite all keys here:
>
> +            for attr in rid_range_attributes:
> +                if attr in entry_attrs:
> +                    updated_values[attr] = entry_attrs[attr]
> +                else:
> +                    updated_values[attr] = int(old_attrs[attr][0])
>
>


-- 
Petr³




More information about the Freeipa-devel mailing list