Generate batches of operations, batched by type of operation, in the order **provided**.
(self)
| 215 | self.ops.append((_DELETE, cmd)) |
| 216 | |
| 217 | def gen_ordered(self) -> Iterator[Optional[_Run]]: |
| 218 | """Generate batches of operations, batched by type of |
| 219 | operation, in the order **provided**. |
| 220 | """ |
| 221 | run = None |
| 222 | for idx, (op_type, operation) in enumerate(self.ops): |
| 223 | if run is None: |
| 224 | run = _Run(op_type) |
| 225 | elif run.op_type != op_type: |
| 226 | yield run |
| 227 | run = _Run(op_type) |
| 228 | run.add(idx, operation) |
| 229 | yield run |
| 230 | |
| 231 | def gen_unordered(self) -> Iterator[_Run]: |
| 232 | """Generate batches of operations, batched by type of |