Proposal for additional `conjunction` parameter in `natural_list` function
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
- localization
Hướng nghiên cứu
Bắt đầu bằng cách tìm phần triển khai natural_list và tài liệu của nó, sau đó xem lại cuộc thảo luận liên quan trong issue #103. Xác nhận cách đầu ra mặc định hiện tại được tạo ra và xác định mọi bài kiểm thử hoặc ví dụ hiện có cho natural_list; được xem là hoàn tất khi hỗ trợ liên từ thay thế được yêu cầu mà vẫn giữ nguyên hành vi mặc định hiện tại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Thank you for the new version; natural_list really resolves several issues.
Summary
I would like to propose an enhancement to the natural_list function. Currently, the output for the list [1, 2, 3] is formatted as "1, 2 and 3". I propose adding a parameter that allows users to choose between "and" or "or" in the output.
I checked the documentation and found in #103 that there is interest in implementing something like this issue.
Motivation
This enhancement would provide more flexibility in how lists are presented, particularly in contexts where the choice between "and" and "or" is significant.
Proposed Changes
- Introduce a new parameter (e.g.,
conjunction) to thenatural_listfunction. - Accept boolean values for this parameter:
True(default behavior)False
Example Usage
With the proposed change, the usage would look like this:
from humanize import natural_list
print(natural_list([1, 2, 3])) # Output: "1, 2 and 3"
print(natural_list([1, 2, 3], conjunction=False)) # Output: "1, 2 or 3"
Another Idea
We could also consider adding or and and to the i18n support for multiple languages, but I believe that should be addressed in a separate issue.
I could submit the PR if there's interest, but I'm not sure if conjunction would be the best name for this parameter.
- Ngôn ngữ chính
- Python
- Star
- 757
- Fork
- 148
- Merge trung bình
- 6 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 12
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.
Issue khác của python-humanize/humanize
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
python-humanize/humanize#379 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
python-humanize/humanize#366 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
python-humanize/humanize#356 · 2 bình luận ·
-
Percentages and ratios Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
python-humanize/humanize#277 · 1 bình luận ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
python-humanize/humanize#270 · 6 bình luận ·
Tất cả issue của python-humanize/humanize
Issue tương tự
-
essnmx good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
[Feature] 奇物选择添加优先级 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
syfoud/Simulated_Scepter#174 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Giskard-AI/giskard-oss#2840 · 1 bình luận ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Đang mởarea: repo bug perceived difficulty: 2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
yeti-platform/yeti#1380 ·