docs: def deferral():
      """Defers a function call when it is being required like Go.
  
      ::
  
         with deferral() as defer:
             sys.setprofile(f)
             defer(sys.setprofile, None)
             # do something.
  
      """
      deferred = []
      defer = lambda f, *a, **k: deferred.append((f, a, k))
      try:
          yield defer
      finally:
          while deferred:
              f, a, k = deferred.pop()
              f(*a, **k)