bundlewrap / bundlewrap

Consider using any PY-W0074
Anti-pattern
Major
6 months ago2 years old
Loop can be refactored to use any
 660        return False
 661
 662    def in_group(self, group_name):
 663        for group in self.groups: 664            if group.name == group_name:
 665                return True
 666        return False
Loop can be refactored to use any
 654        return hash_statedict(self.cdict)
 655
 656    def in_any_group(self, group_list):
 657        for group_name in group_list: 658            if self.in_group(group_name):
 659                return True
 660        return False
Loop can be refactored to use any
 645        return False
 646
 647    def has_bundle(self, bundle_name):
 648        for bundle in self.bundles: 649            if bundle.name == bundle_name:
 650                return True
 651        return False
Loop can be refactored to use any
 639                yield parent_group
 640
 641    def has_any_bundle(self, bundle_list):
 642        for bundle_name in bundle_list: 643            if self.has_bundle(bundle_name):
 644                return True
 645        return False
Loop can be refactored to use any
 26    Braindead check to see if our rev is a branch or tag name. False
 27    negatives are OK since this is only used for optimization.
 28    """
 29    for char in rev: 30        if char not in "0123456789abcdef":
 31            return True
 32    return False