from __future__ import generators

def enumerate(things, i=0):
    "Produces an iterator that return"
    for thing in things:
        yield (thing, i)
        i += 1

def printer(t): print "%s::%s" % t

def mash(l, r):
    """Joins two strings so they have one space between them."""
    return l.rstrip() + ' ' + r.lstrip()

if __name__ == '__main__':
    l = 'foo bar baz quux'.split()
    for kv in enumerate(l):
        printer(kv)
        
