python / python/cpython

IDLE: add a Unicode character browser

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

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

stdlib topic-IDLE type-feature
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

IDLE has no way to browse or search for a Unicode character. Inserting one requires already knowing its code point (and typing an escape) or pasting it from another application.

Besides making characters easy to insert, such a tool is useful for learning about Unicode — exploring blocks, looking up a character's name, category, and other properties, and seeing how it is written as an escape, as UTF-8 bytes, as an XML or HTML reference, and in the normalization forms.

I propose a Character Browser, similar to KDE's kcharselect and GNOME Characters, added as a CharSelect extension on the Edit menu (available in both the Shell and the editor).

Features:

  • A grid of Unicode blocks selected from a drop-down, scrollable, with hover and selection highlight.
  • Search by character name substring, or by code point in many notations: U+2764, 0x2764, ❤, ❤, a bare hex/decimal number, \u/\U/\x/\N{...}/simple escapes, surrogate pairs, and a UTF-8 byte escape run.
  • A detail panel with three tabs: an Overview (name, code point, decimal), a Repr tab (literal, Python escape, UTF-8 bytes, surrogate pair, XML and HTML references, \N{...}), and a Unicode tab (block, category, bidi, combining, East Asian width, mirrored, decomposition, numeric values, and normalization forms).
  • Insert the character at the cursor of the editor or Shell (replacing any selection, and staying within the Shell's input area), or Copy it to the clipboard. Double-clicking a character in the grid inserts it.
  • On the detail tabs, clicking a value copies it and double-clicking inserts it.

When opened with an editor selection, the browser seeds the search with it.

A PR will follow.

Related (not a duplicate): #80648 (help with invisible characters).

Linked PRs
  • gh-152945

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.

Hướng nghiên cứu

Bắt đầu bằng việc xem xét tiện ích mở rộng CharSelect được đề xuất trong menu Edit của IDLE và PR gh-152945 được liên kết. So sánh phần triển khai với các yêu cầu đã liệt kê về duyệt, tìm kiếm, thông tin chi tiết, chèn và sao chép Unicode cho cả Shell và trình soạn thảo; hoàn tất nghĩa là phạm vi đã thống nhất được triển khai và xác minh.

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
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
25/100

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.