code: def view(model: "Model", *functions: Callable) -> Optional[Callable]:
      
      if not isinstance(model, Model):
          raise TypeError("Expected a Model, not %r." % model)
  
      def setup(function: Callable):
          model._model_views.append(function)
          return function
  
      if functions:
          for f in functions:
              setup(f)
      else:
          return setup
docs: A decorator for registering a callback to a model
  
      Parameters:
          model: the model object whose changes the callback should respond to.
  
      Examples:
          .. code-block:: python
  
              from spectate import mvc
  
              items = mvc.List()
  
              @mvc.view(items)
              def printer(items, events):
                  for e in events:
                      print(e)
  
              items.append(1)