INNER CODE UNIT · Python

eq

weaveworks/kubediff · kubedifflib/_diff.py:101

    def eq(x, y):
        return len(list(diff('', x, y))) == 0

    for i in list_subtract(want, have, eq):
        yield missing_item(path, "element [%d]" % i)


def list_subtract(xs, ys, equality=operator.eq):
    """Return items in 'xs' but not in 'ys'."""
    matched = set()
    for i, x in enumerate(xs):
        for j, y in enumerate(ys):
            if j in matched:
                continue
            if equality(x, y):
                matched.add(j)
                break
        else:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…