MCPcopy Create free account
hub / github.com/ipython/ipython / _format_lineno

Method _format_lineno

IPython/core/magics/history.py:140–144  ·  view source on GitHub ↗

Helper function to format line numbers properly.

(session, line)

Source from the content-addressed store, hash-verified

138 history_manager = self.shell.history_manager
139
140 def _format_lineno(session, line):
141 """Helper function to format line numbers properly."""
142 if session in (0, history_manager.session_number):
143 return str(line)
144 return "%s/%s" % (session, line)
145
146 # Check if output to specific file was requested.
147 outfname = args.filename

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected