Modernize Code In IDLELib Editor Backspace
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ả
(and potentially deprecate handling of tabs in IDLE, though likely separate issue)
In https://github.com/python/cpython/issues/136061, https://github.com/python/cpython/blob/561212a03306cb2f246771e9c4748bec1dc41405/Lib/idlelib/editor.py#L1365-L1385 is mentioned as an area of code with quadratic complexity, which may lead to performance issues; though this is unlikely to be of large impact in practice because attackers with the ability to get a huge file loaded and/or modify configuration files to change the tab width can do much worse things than getting IDLE to hang on hitting backspace.
However, the complexity there comes from a loop which handles situations (files with tabs) that either cannot or should not occur; in the current default IDLE, you can't put tabs, and a space after a tab should just be deleted in a file coming from elsewhere as in indicated in https://github.com/python/cpython/pull/134874#issuecomment-3014981765. Therefore, simplifying the function specification and/or deprecating IDLE to handle tabs (which we should do) will allow elimination of this piece of obsolete code, as indicated in https://github.com/python/cpython/issues/136061#issuecomment-3016093746.
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
Trước tiên, hãy đọc các dòng 1365–1385 trong Lib/idlelib/editor.py, sau đó xem xét issue 136061 và phần thảo luận được liên kết trong PR 134874. Làm rõ liệu issue này bao gồm việc đơn giản hóa xử lý Backspace, ngừng sử dụng xử lý Tab, hay cả hai; issue được hoàn tất khi phạm vi đã thống nhất được triển khai và hành vi không còn phù hợp được xử lý.
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
- desktop, tooling
- Loại issue
- Tái cấu trúc
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 35/100