The Sage ZMQ Kernel#

Version of the Jupyter kernel when running Sage inside the Jupyter notebook or remote Jupyter sessions.

class sage.repl.ipython_kernel.kernel.SageKernel(**kwargs: Any)#

Bases: IPythonKernel

The Sage Jupyter Kernel

INPUT:

See the Jupyter documentation

EXAMPLES:

sage: from sage.repl.ipython_kernel.kernel import SageKernel
sage: SageKernel.__new__(SageKernel)
<sage.repl.ipython_kernel.kernel.SageKernel object at 0x...>
property banner#

The Sage Banner

The value of this property is displayed in the Jupyter notebook.

OUTPUT:

String.

EXAMPLES:

sage: from sage.repl.ipython_kernel.kernel import SageKernel
sage: sk = SageKernel.__new__(SageKernel)
sage: print(sk.banner)
┌...SageMath version...

Help in the Jupyter Notebook

OUTPUT:

See the Jupyter documentation.

EXAMPLES:

sage: from sage.repl.ipython_kernel.kernel import SageKernel
sage: sk = SageKernel.__new__(SageKernel)
sage: sk.help_links
[{'text': 'Sage Documentation',
  'url': 'https://doc.sagemath.org/html/en/index.html'},
 ...]
implementation: str = 'sage'#
implementation_version: str = '10.3'#
pre_handler_hook()#

Restore the signal handlers to their default values at Sage startup, saving the old handler at the saved_sigint_handler attribute. This is needed because Jupyter needs to change the SIGINT handler.

See github issue #19135.

shell_class#

A trait whose value must be a subclass of a specified class.

class sage.repl.ipython_kernel.kernel.SageZMQInteractiveShell(**kwargs: Any)#

Bases: SageNotebookInteractiveShell, ZMQInteractiveShell