for scope in known_scopes:
if scope:
outer_scope, _, _ = scope.rpartition(".")
if outer_scope in leaf_scopes:
leaf_scopes.discard(outer_scope)
leaf_scopes.add(scope)
for scope in leaf_scopes:
self._known_scoping_prefixes["{0}-".format(scope.replace(".", "-"))] = scope
After Change
// Check for prefixes in reverse order, so we match the longest prefix first.
self._known_scoping_prefixes = [("{0}-".format(scope.replace(".", "-")), scope)
for scope in filter(None, sorted(self._known_scopes, reverse=True))]
@property
def is_help(self):