code: def handler(event):
      
      def decorator(fn):
          def apply(cls):
              event.connect(fn, sender=cls)
              return cls
  
          fn.apply = apply
          return fn
      return decorator
docs: Signal decorator to allow use of callback functions as class decorators.