from django import template

register = template.Library()

@register.filter
def zip(*args):
    args = list(args) + [[]] * (3 - len(args))
    args = args[:3]
    args = [arg if isinstance(arg, (list, tuple)) else [] for arg in args]
    return list(zip(*args))