Get KeyError: '_oh' when running a recursion in jupyter notebook

It would be nice if someone here can shed some light on the technical reason behind the different behavior; however, to save others some time investigating, I’ll point out:

  • This is a cross-post with here.
  • As pointed out in the comments in the cross-post this behavior is not reproducible in current Jupyter notebooks or JupyterLab. Running the code in the first code clock works and reports the result with no raised error. No addition of print() is needed.

The raised error specifically says # Avoid recursive reference when displaying _oh/Out, and so it is an issue with the recursion.