ipython / ipython/ipykernel

iPython doesn't show exception.add_note()

Đang mở
#1,115 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
734
Fork
412
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
8

Mô tả

[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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.