def vararg_decorator(f):
    '''Decorator to handle variable argument decorators.'''

    @wraps(f)
    def decorator(*args, **kwargs):
        if len(args) == 1 and len(kwargs) == 0 and callable(args[0]):
            return f(args[0])
        else:
            return lambda realf: f(realf, *args, **kwargs)

    return decorator
def vararg_decorator ( f ) : @ wraps ( f ) def decorator ( * args , ** kwargs ) : if len ( args ) == 1 and len ( kwargs ) == 0 and callable ( args [ 0 ] ) : return f ( args [ 0 ] ) else : return lambda realf : f ( realf , * args , ** kwargs ) return decorator
Decorator to handle variable argument decorators.