Add positional-only parameters
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/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
- backend-api-design
Hướng nghiên cứu
Start with PEP 570 and the issue's Point example, then examine how attrs' attrib option and generated repr currently handle parameters. Define the expected positional-only behavior and verify that the example produces Point((0, 1, 2)) rather than Point(_data=(0, 1, 2)).
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
With PEP 570, positional-only parameters were introduced.
Similarly to keyword-only parameters, I would like to see these as an option for attrs.
One thing that makes them "special" is that the __repr__ method would behave differently for positional-only parameters than it would for regular positional parameters.
An example I would use in my libraries:
from attr import attrib, attrs
@attrs(auto_attribs=True)
class Point:
"""A three-dimensional point."""
_data: Tuple[float, float, float] = attrib(positional_only=True)
print(Point((0, 1, 2)))
The output would then be
Point((0, 1, 2))
instead of
Point(_data=(0, 1, 2))
If this were a desirable feature, would this be a good "first pull request" I could follow up on?
- Ngôn ngữ chính
- Python
- Star
- 5.8k
- Fork
- 480
- Merge trung bình
- 2 giờ 15 phút
- Pull request đã merge (30 ngày)
- 2
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-attrs/attrs
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
python-attrs/attrs#1620 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
python-attrs/attrs#1596 · 2 bình luận · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
python-attrs/attrs#1549 · 3 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
python-attrs/attrs#1543 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
python-attrs/attrs#1532 ·
Tất cả issue của python-attrs/attrs
Issue tương tự
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
open-webui/open-webui#30750 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100