def attach(self, upstream):
        """Attach an upstream to the last upstream. Can be removed with detach"""

        if upstream == self.last_upstream():
            raise Exception("Can't attach a cache to itself")

        self._prior_upstreams.append(self.last_upstream())

        self.last_upstream().upstream = upstream
def attach ( self , upstream ) : if upstream == self . last_upstream ( ) : raise Exception ( "Can't attach a cache to itself" ) self . _prior_upstreams . append ( self . last_upstream ( ) ) self . last_upstream ( ) . upstream = upstream
Attach an upstream to the last upstream. Can be removed with detach