code: def register_postloop_hook(self, func: Callable[[None], None]) -> None:
          
          self._validate_prepostloop_callable(func)
          self._postloop_hooks.append(func)
docs: Register a function to be called at the end of the command loop.