<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self, old, new=None):
 """ Update given view declaration with new declaration Parameters old: Declarative The existing view instance that needs to be updated new: Declarative or None The new or reloaded view instance to that will be used to update the existing view. If none is given, one of the same type as old will be created and initialized with no attributes passed. """

        #: Create and initialize
        if not new:
            new = type(old)()
            if not new.is_initialized:
                 new.initialize()
        if self.debug:
            print("Updating {} with {}".format(old, new))

        #: Update attrs, funcs, and bindings of this node
        self.update_attrs(old, new)
        self.update_funcs(old, new)
        self.update_bindings(old, new)

        #: Update any child pattern nodes before the children
        self.update_pattern_nodes(old, new)

        #: Now update any children
        self.update_children(old, new)