Feature: Support `filename:function` syntax for pdb break and clear command
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 77.2k
- Fork
- 35.9k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
Feature or enhancement
Proposal:
Currently, pdb's break command supports filename:lineno or just function (in the current context or imported modules). However, it does not support the filename:function syntax.
Attempting to use break filename:function usually results in a Error because pdb expects the part after the colon to be a line number.
main.py:
def foo():
pass
bash-5.3# ./python -m pdb main.py
> /workspaces/cpython/main.py(1)<module>()
-> def foo():
(Pdb) b main:foo
*** Bad lineno: foo
This syntax is useful for specifying a function in a specific file, especially to disambiguate if multiple files have the same function name, or if the file hasn't been loaded yet but the user wants to be explicit.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-142470
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với phần xử lý hiện có các lệnh break và clear của pdb, so sánh các đường dẫn phân giải filename:lineno và function. Tái hiện ví dụ main.py bằng b main:foo, sau đó xác minh rằng filename:function hoạt động mà không làm phát sinh hồi quy ở các dạng hiện có; issue tham chiếu đến PR được liên kết gh-142470.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- cli
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 25/100