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

Function show_linewise_tokens

IPython/core/inputtransformer2.py:508–516  ·  view source on GitHub ↗

For investigation and debugging

(s: str)

Source from the content-addressed store, hash-verified

506 return tokens_by_line
507
508def show_linewise_tokens(s: str):
509 """For investigation and debugging"""
510 if not s.endswith('\n'):
511 s += '\n'
512 lines = s.splitlines(keepends=True)
513 for line in make_tokens_by_line(lines):
514 print("Line -------")
515 for tokinfo in line:
516 print(" ", tokinfo)
517
518# Arbitrary limit to prevent getting stuck in infinite loops
519TRANSFORM_LOOP_LIMIT = 500

Callers

nothing calls this directly

Calls 1

make_tokens_by_lineFunction · 0.85

Tested by

no test coverage detected