This is a development version (9.14.0.dev) and may be unstable. Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.14.0.dev / IPython / core / history / extract_hist_ranges

function

IPython.core.history:extract_hist_ranges

source: /IPython/core/history.py :1213

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"))
list(extract_hist_ranges("~4/"))
list(extract_hist_ranges("4-"))
list(extract_hist_ranges("~4/4-"))

Aliases

  • IPython.core.history.extract_hist_ranges