This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: kernel.comm.manager

Base class to manage comms

1 Class

class IPython.kernel.comm.manager.CommManager(**kwargs)

Bases: IPython.config.configurable.LoggingConfigurable

Manager for Comms in the Kernel


Get a comm with a particular id

Returns the comm if found, otherwise None.

This will not raise an error, it will log messages if the comm cannot be found.


Register a new comm

register_target(target_name, f)

Register a callable f for a given target name

f will be called with two arguments when a comm_open message is received with target:

  • the Comm instance
  • the comm_open message itself.

f can be a Python callable or an import string for one.


Unregister a comm, and close its counterpart

unregister_target(target_name, f)

Unregister a callable registered with register_target

2 Functions


Return lazy-evaluated string representation of a dictionary’s keys

Key list is only constructed if it will actually be used. Used for debug-logging.


method decorator for ensuring output is handled properly in a message handler

  • sets parent header before entering the method
  • publishes busy/idle
  • flushes stdout/stderr after