<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def application(self, value):
 """Update the application."""


        # Always allow None
        if value is None:
            self._application = None
            return

        # Check that the state is valid
        if not isinstance(value, application.Application):
            raise ValueError("application must be an instance of "
                             "tendril.Application")

        self._application = value