def simplify_class_decorator(class_decorator):
 @wraps(class_decorator)
 def outer(fn=None, *decorator_args, **decorator_kwargs):
  def actual_decorator(fn):
   instance = class_decorator(fn, *decorator_args, **decorator_kwargs)
   _wrapped_view = instance.__call__()
   return _wrapped_view
  if (fn is not None):
   wrapped_view = actual_decorator(fn)
  else:
   wrapped_view = actual_decorator
  return wrapped_view
 return outer

def simplify_class_decorator ( class_decorator ) : @ wraps ( class_decorator ) def outer ( fn = None , * decorator_args , ** decorator_kwargs ) : def actual_decorator ( fn ) : instance = class_decorator ( fn , * decorator_args , ** decorator_kwargs ) _wrapped_view = instance . __call__ ( ) return _wrapped_view if ( fn is not None ) : wrapped_view = actual_decorator ( fn ) else : wrapped_view = actual_decorator return wrapped_view return outer
makes the decorator syntax uniform regardless if you call the decorator like **decorator examples**:: @decorator or @decorator() or @decorator complexity .