···133133 else:
134134 self.elements.extend(iterable)
135135 def insert(self, i, element):
136136+ '''Inserts a top-level element at the given array index.'''
136137 self.elements.insert(i, element)
137138 def remove(self, element):
139139+ '''Removes a top-level element (except those with a z-index).'''
138140 self.elements.remove(element)
139141 def clear(self):
142142+ '''Clears all drawing elements, with or without a z-index, but keeps
143143+ defs-type elements added with `append_def()`.
144144+ '''
140145 self.elements.clear()
146146+ self.ordered_elements.clear()
141147 def index(self, *args, **kwargs):
148148+ '''Finds the array-index of a top-level element (except those with a
149149+ z-index).
150150+ '''
142151 return self.elements.index(*args, **kwargs)
143152 def count(self, element):
153153+ '''Counts the number of top-level elements (except those with a z-index
154154+ ).
155155+ '''
144156 return self.elements.count(element)
145157 def reverse(self):
158158+ '''Reverses the order of all elements (except those with a z-index).'''
146159 self.elements.reverse()
147160 def draw_def(self, obj, **kwargs):
148161 if not hasattr(obj, 'write_svg_element'):