Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Suggestion: append info about code block number in filename

Đang mở
#716 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
42/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu với ipykernel/compiler.py quanh dòng 50, nơi tên tệp tạm thời được tạo, và theo dõi cách số khối mã có sẵn khi tên tệp đó được ghép lại. Xác nhận định dạng tên tệp mong muốn cho các mục traceback và kiểm tra các bài kiểm thử hiện có liên quan đến compiler hoặc việc đặt tên tệp tạm thời; hoàn tất khi tên tệp vẫn giữ số khối mã mà không làm mất thông tin đường dẫn dễ đọc.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

When using IPython, the "filename" contains the number information of the code block that contains it; this is something of the form <ipython-input-N-...> where N is the code block number.
image

When actual temporary files are used in the ipykernel, the names created on https://github.com/ipython/ipykernel/blob/b2f1a79f64c49a1c54f2e7c79c062d6b347b9bf0/ipykernel/compiler.py#L50 lose that information.
My suggestion would be to append _number to the filename where number is the code block number. So, instead of path/to/filename.py one would have path/to/filename_number.py. This would enable a human reader to identify which code block is involved in the traceback.

Additionally, while it is currently possible to programmatically obtain the information and having a "filename" much more understable, as demonstrated in the image below, there can be some ambiguity if the exact same content appears in two code blocks, one of which appearing in a traceback (as shown in the second traceback in the image below).

Adding the _number would remove this ambiguity.
image

Ngôn ngữ chính
Python
Star
734
Fork
411
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
9

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

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ipython/ipykernel

Tất cả issue của ipython/ipykernel

Issue tương tự

Thêm issue về Python

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.