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)[source]

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...>
>>> from sage.all import *
>>> from sage.repl.ipython_kernel.kernel import SageKernel
>>> 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...
>>> from sage.all import *
>>> from sage.repl.ipython_kernel.kernel import SageKernel
>>> sk = SageKernel.__new__(SageKernel)
>>> 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': '.../html/en/index.html'},
 ...]
>>> from sage.all import *
>>> from sage.repl.ipython_kernel.kernel import SageKernel
>>> sk = SageKernel.__new__(SageKernel)
>>> sk.help_links
[{'text': 'Sage Documentation',
  'url': '.../html/en/index.html'},
 ...]
implementation: str = 'sage'
implementation_version: str = '10.5'
pre_handler_hook()[source]

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 Issue #19135.

shell_class[source]

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

class sage.repl.ipython_kernel.kernel.SageZMQInteractiveShell(**kwargs: Any)[source]

Bases: SageNotebookInteractiveShell, ZMQInteractiveShell