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

bundles / IPython latest / IPython / core / magic / Magics

MetaHasTraits

IPython.core.magic:Magics

source: /IPython/core/magic.py :589

Signature

def   Magics ( shell : InteractiveShell | None = None ** kwargs : Any )  →  None

Members

Summary

Base class for implementing magic functions.

Extended Summary

Shell functions which can be reached as %function_name. All magic functions should accept a string, which they can parse for their own needs. This can make some functions easier to type, eg %cd ../ vs. %cd("../")

Classes providing magic functions need to subclass this class, and they MUST:

  • Use the method decorators @line_magic and @cell_magic to decorate individual methods as magic functions, AND

  • Use the class decorator @magics_class to ensure that the magic methods are properly registered at the instance level upon instance initialization.

See magic_functions for examples of actual implementation classes.

Aliases

  • IPython.core.magic.Magics

Referenced by