bundles / IPython 9.5.0 / IPython / core / history / extract_hist_ranges
function
IPython.core.history:extract_hist_ranges
source: /IPython/core/history.py:1164
Signature
def extract_hist_ranges(ranges_str: str) → Iterable[tuple[int, int, Optional[int]]]Summary
Turn a string of history ranges into 3-tuples of (session, start, stop).
Extended Summary
Empty string results in a [(0, 1, None)], i.e. "everything from current session".
Examples
list(extract_hist_ranges("~8/5-~7/4 2"))
✓[(-8, 5, None), (-7, 1, 5), (0, 2, 3)]
Aliases
IPython.core.history.extract_hist_ranges