def lazylist(producer):
    """Decorator for creating a RecursiveLazyList subclass.
    This should decorate a generator function taking the LazyList object as its
    first argument which yields the contents of the list in order.
    """
    #ABCMeta is the metaclass of LazyList and its subclasses
    return abc.ABCMeta(producer.__name__,
                       (RecursiveLazyList,),
                       dict(_producer = producer))
Decorator for creating a RecursiveLazyList subclass.
    This should decorate a generator function taking the LazyList object as its
    first argument which yields the contents of the list in order.
    
recipes/Python/576410_Lazy_Lists/recipe-576410.py