code: def update_name(self, name):
          
          if name != self.name:
              self.parent.types[name] = self
              del self.parent.types[self.name]
              self.name = name
docs: Updates the name of the custom type in this instance and its
          parent reference.