def union_ip(self, rect): """ Change this rect to represent the union of rect and this rect. """ r = Rectangle.union(self, rect) self.setLocation(r.x, r.y) self.setSize(r.width, r.height) return None
def unionall(self, rect_list): """ Return Rect representing the union of rect list and this rect. """ r = self for rect in rect_list: r = Rectangle.union(r, rect) return Rect(r.x, r.y, r.width, r.height)
def unionall_ip(self, rect_list): """ Change this rect to represent the union of rect list and this rect. """ r = self for rect in rect_list: r = Rectangle.union(r, rect) self.setLocation(r.x, r.y) self.setSize(r.width, r.height) return None
def union(self, rect): """ Return Rect representing the union of rect and this rect. """ r = Rectangle.union(self, rect) return Rect(r.x, r.y, r.width, r.height)