| 1814 | dispatch[APPEND[0]] = load_append |
| 1815 | |
| 1816 | def load_appends(self): |
| 1817 | items = self.pop_mark() |
| 1818 | list_obj = self.stack[-1] |
| 1819 | try: |
| 1820 | extend = list_obj.extend |
| 1821 | except AttributeError: |
| 1822 | pass |
| 1823 | else: |
| 1824 | extend(items) |
| 1825 | return |
| 1826 | # Even if the PEP 307 requires extend() and append() methods, |
| 1827 | # fall back on append() if the object has no extend() method |
| 1828 | # for backward compatibility. |
| 1829 | append = list_obj.append |
| 1830 | for item in items: |
| 1831 | append(item) |
| 1832 | dispatch[APPENDS[0]] = load_appends |
| 1833 | |
| 1834 | def load_setitem(self): |