A path is not simply reversible by path[::-1] since the code specifies an action to take from the **previous** point.
(self, path, first_action=Path.LINETO)
| 330 | return tip, label_location |
| 331 | |
| 332 | def _revert(self, path, first_action=Path.LINETO): |
| 333 | """ |
| 334 | A path is not simply reversible by path[::-1] since the code |
| 335 | specifies an action to take from the **previous** point. |
| 336 | """ |
| 337 | reverse_path = [] |
| 338 | next_code = first_action |
| 339 | for code, position in path[::-1]: |
| 340 | reverse_path.append((next_code, position)) |
| 341 | next_code = code |
| 342 | return reverse_path |
| 343 | # This might be more efficient, but it fails because 'tuple' object |
| 344 | # doesn't support item assignment: |
| 345 | # path[1] = path[1][-1:0:-1] |
| 346 | # path[1][0] = first_action |
| 347 | # path[2] = path[2][::-1] |
| 348 | # return path |
| 349 | |
| 350 | @_docstring.interpd |
| 351 | def add(self, patchlabel='', flows=None, orientations=None, labels='', |