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

bundles / IPython 9.18.0.dev / IPython / terminal / ptutils / _LazyPygmentsLexer

class

IPython.terminal.ptutils:_LazyPygmentsLexer

source: /dev/ipython/IPython/terminal/ptutils.py:200

Signature

class _LazyPygmentsLexer(pygments_cls_name: str)

Members

Summary

A PygmentsLexer-like object that only builds the real lexer (and imports the pygments submodule backing it) the first time it's actually asked to highlight something.

Extended Summary

Most sessions only ever use the Python lexer; building all the per-%%magic lexers (bash, html, javascript, perl, ruby, latex...) up front measurably slows down every terminal startup for languages that may never come up in that session.

Aliases

  • IPython.terminal.ptutils._LazyPygmentsLexer