even

returns even elements.

Source


def even(self):
    ret = pyNodeList()
    is_even = False
    for node in self:
        if is_even: ret.append(node)
        is_even = not is_even
    if len(ret) == 1: return ret[0]
    else: return ret