ipython / ipython/ipykernel

Handling a comms message has side effects

Offen
#432 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
734
Forks
412
Ø Merge
1 T. 5 Std.
Gemergte PRs (30 T.)
8

Beschreibung

When handling comms messages, the kernel calls `shell.events.trigger('pre_execute')` and `self.shell.callbacks.fire('post_execute')`. This limits the utility of comms messages as sending a comms message to the kernel has quite substantial side effects. For example, any pending matplotlib figure are plotted as soon as a comms message is received. I am using comms in spyder to communicate between the kernel and the frontend. Is there a reason why `pre/post_execute` need to be triggered when handling a generic comms message?
I am using monkey-patching to remove these calls in spyder, and I was wondering if this is something that should be fixed upstream.

Line for ref:
https://github.com/ipython/ipykernel/blob/97d10d4c9e0bd558c3b696e8cc51d23d3223a071/ipykernel/comm/comm.py#L161

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.