def append(self, val):
<EOL>_lists = self._lists<EOL>_keys = self._keys<EOL>_maxes = self._maxes<EOL>key = self._key(val)<EOL>if not _maxes:<EOL><INDENT>_maxes.append(key)<EOL>_keys.append([key])<EOL>_lists.append([val])<EOL>self._len = <NUM_LIT:1><EOL>return<EOL><DEDENT>pos = len(_keys) - <NUM_LIT:1><EOL>if key < _keys[pos][-<NUM_LIT:1>]:<EOL><INDENT>msg = '<STR_LIT>'.format(val, self._len)<EOL>raise ValueError(msg)<EOL><DEDENT>_lists[pos].append(val)<EOL>_keys[pos].append(key)<EOL>_maxes[pos] = key<EOL>self._len += <NUM_LIT:1><EOL>self._expand(pos)<EOL>
Append the element *val* to the list. Raises a ValueError if the *val*
would violate the sort order.