ipython / ipython/ipykernel

iPython doesn't show exception.add_note()

Abierto
#1,115 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
734
Forks
412
Merge medio
1 d 5 h
PR fusionados (30 d)
8

Descripción

[PEP 678](https://peps.python.org/pep-0678) added in 3.11 allows enriching exceptions with notes. This works in the REPL:

```py
>>> try:
... raise TypeError('bad type')
... except Exception as e:
... e.add_note('Add some information')
... raise
...
Traceback (most recent call last):
File "", line 2, in
TypeError: bad type
Add some information
```

Entering the same in a Jupyter notebook using a 3.11 kernel, I don't see the note:

```py
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Untitled-1.ipynb Cell 1 in 2
1 try:
----> 2 raise TypeError('bad type')
3 except Exception as e:
4 e.add_note('Add some information')

TypeError: bad type
```

Related issue: https://github.com/microsoft/vscode-jupyter/issues/13446

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.