Document IMAP4.append() message type and optional arguments
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ả
The IMAP4.append() documentation currently says only:
Append message to named mailbox.
It now documents the flags argument, but the remaining argument behavior is still easier to discover from Lib/imaplib.py than from the library docs.
In the implementation:
mailboxis treated as optional in practice: a false value is replaced with'INBOX'.flagsanddate_timemay beNone, in which case they are omitted from the command.messageis not optional. It is passed toMapCRLF.sub(CRLF, message), whereMapCRLFis a bytes regular expression, somessagemust be a bytes-like object. Passing astrraisesTypeErrorbefore the command is sent.
The method docstring already hints at this by saying "All args except 'message' can be None", but that detail is not in Doc/library/imaplib.rst.
This is related to the broader documentation issue in #68215, but this issue is intentionally narrower: clarify the public documentation for IMAP4.append() only.
Suggested documentation scope:
- State that message must be a bytes-like object.
- State which arguments may be
None. - Clarify that
mailbox=None(or another false value) usesINBOX. - Clarify that
date_time=Noneomits the internal date argument.
This should stay separate from the existing CR/LF-normalization behavior tracked in #49680.
Linked PRs
- gh-149964
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
Mở Doc/library/imaplib.rst và tìm phần tài liệu công khai cho IMAP4.append(). Cập nhật phần này để bao quát yêu cầu thông điệp phải có dạng bytes-like, những đối số nào có thể là None, các giá trị mailbox falsy mặc định thành INBOX, và date_time=None bỏ qua đối số ngày nội bộ; PR được liên kết cho biết công việc này đã được tiến hành.
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
- documentation
- Loại issue
- Tài liệu
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- 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