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

bundles / IPython latest / IPython / utils / PyColorize / _pygments_base_styles

function

IPython.utils.PyColorize:_pygments_base_styles

source: /IPython/utils/PyColorize.py:76

Signature

def _pygments_base_styles(name: str) → Any

Summary

Return the token -> style-string mapping of a pygments style, by name.

Extended Summary

Equivalent to pygments.styles.get_style_by_name(name).styles, which is all IPython ever wants from a base style, but able to answer for the handful of builtin styles IPython's own themes are based on without importing pygments.styles.

Importing that package -- which importing any of its submodules does too -- runs pygments.plugin, and with it importlib.metadata and email: roughly 10ms whose only purpose is to make third party style plugins findable by name. No theme IPython ships needs that, and this is on the startup path.

Aliases

  • IPython.utils.PyColorize._pygments_base_styles