code: def onfini(self, func):
          '''
          Add a function/coroutine/Base to be called on fini().
          '''
          if isinstance(func, Base):
              self.tofini.add(func)
              return
  
          assert self.anitted
          self._fini_funcs.append(funcf onfini(self, func):
          '''
          Add a function/coroutine/Base to be called on fini().
          '''
          if isinstance(func, Base):
              self.tofini.add(func)
              return
  
          assert self.anitted
          self._fini_funcs.append(func)
docs: Add a function/coroutine/Base to be called on fini().