| 1666 | dispatch[APPEND[0]] = load_append |
| 1667 | |
| 1668 | def load_appends(self): |
| 1669 | items = self.pop_mark() |
| 1670 | list_obj = self.stack[-1] |
| 1671 | try: |
| 1672 | extend = list_obj.extend |
| 1673 | except AttributeError: |
| 1674 | pass |
| 1675 | else: |
| 1676 | extend(items) |
| 1677 | return |
| 1678 | # Even if the PEP 307 requires extend() and append() methods, |
| 1679 | # fall back on append() if the object has no extend() method |
| 1680 | # for backward compatibility. |
| 1681 | append = list_obj.append |
| 1682 | for item in items: |
| 1683 | append(item) |
| 1684 | dispatch[APPENDS[0]] = load_appends |
| 1685 | |
| 1686 | def load_setitem(self): |