MCPcopy Index your code
hub / github.com/ipython/ipython / get_last_session_id

Method get_last_session_id

IPython/core/history.py:432–440  ·  view source on GitHub ↗

Get the last session ID currently in the database. Within IPython, this should be the same as the value stored in :attr:`HistoryManager.session_number`.

(self)

Source from the content-addressed store, hash-verified

430
431 @catch_corrupt_db
432 def get_last_session_id(self) -> Optional[int]:
433 """Get the last session ID currently in the database.
434
435 Within IPython, this should be the same as the value stored in
436 :attr:`HistoryManager.session_number`.
437 """
438 for record in self.get_tail(n=1, include_latest=True):
439 return record[0]
440 return None
441
442 @catch_corrupt_db
443 def get_tail(

Callers

nothing calls this directly

Calls 1

get_tailMethod · 0.95

Tested by

no test coverage detected