Iterate over a sequence of row coordinates.
(self, sequence: Sequence)
| 1730 | return internal_to_flavor(coords, self.flavor) |
| 1731 | |
| 1732 | def itersequence(self, sequence: Sequence) -> Iterator[tableextension.Row]: |
| 1733 | """Iterate over a sequence of row coordinates.""" |
| 1734 | if not hasattr(sequence, "__getitem__"): |
| 1735 | raise TypeError( |
| 1736 | "Wrong 'sequence' parameter type. Only sequences " |
| 1737 | "are suported." |
| 1738 | ) |
| 1739 | # start, stop and step are necessary for the new iterator for |
| 1740 | # coordinates, and perhaps it would be useful to add them as |
| 1741 | # parameters in the future (not now, because I've just removed |
| 1742 | # the `sort` argument for 2.1). |
| 1743 | # |
| 1744 | # *Important note*: Negative values for step are not supported |
| 1745 | # for the general case, but only for the itersorted() and |
| 1746 | # read_sorted() purposes! The self._process_range_read will raise |
| 1747 | # an appropriate error. |
| 1748 | # F. Alted 2008-09-18 |
| 1749 | # A.V. 20130513: _process_range_read --> _process_range |
| 1750 | start, stop, step = self._process_range(None, None, None) |
| 1751 | if (start > stop) or (len(sequence) == 0): |
| 1752 | return iter([]) |
| 1753 | row = tableextension.Row(self) |
| 1754 | return row._iter(start, stop, step, coords=sequence) |
| 1755 | |
| 1756 | def _check_sortby_csi( |
| 1757 | self, sortby: Column | str, check_csi: bool |