def __init__(self, name, filename=None):
        self.name = name
        super(NamedRequirements, self).__init__(filename=filename)
def badmatch(match, badfn):
    """Make a copy of the given matcher, replacing its bad method with the given
    one.
    """
    m = copy.copy(match)
    m.bad = badfn
    return m