RegistryOption lists help strings in arbitrary order

Bug #559409 reported by Martin von Gagern on 2010-04-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Medium
Martin von Gagern

Bug Description

RegistryOption.from_kwargs adds the help strings for its arguments to the help string of the RegistryOption it returns. It does so based on kwargs.iteritems(). This results in these help strings being included in an arbitrary and implementation-dependant order, which shouldn't be a serious problem but is ugly nevertheless.

I suggest that the arguments be traversed in a fixed order. I'd prefer the order they were specified in the function call, but I see no way to extract this information from a kwargs dict, and no way to get **kwargs-style behaviour without actually using a dict. So for lack of a better alternative, I'd instead suggest traversing arguments in sorted order:
- for name, switch_help in kwargs.iteritems():
+ for name, switch_help in sorted(kwargs.items()):

This behaviour is also consistent with the case of RegistryOption(value_switches=True), which uses the sorted list returned by Registry.keys().

Related branches

Martin Pool (mbp) on 2010-04-12
Changed in bzr:
importance: Undecided → Medium
status: New → In Progress
John A Meinel (jameinel) on 2010-08-06
Changed in bzr:
assignee: nobody → Martin von Gagern (gagern)
status: In Progress → Fix Released
milestone: none → 2.2.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers