[Refactor] Use walrus operator in study.py (Python 3.10+ upgrade)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 92/100
Hướng nghiên cứu
Mở openml/study/study.py quanh dòng 151 và 162, nơi có các phép gán content, các kiểm tra None và các chú thích TODO lỗi thời về walrus operator. Kết hợp mỗi phép gán và kiểm tra bằng walrus operator, xóa các chú thích TODO đã được giải quyết và xác minh rằng hành vi vẫn không thay đổi theo yêu cầu Python 3.10+.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
The openml-python project recently bumped its minimum Python version requirement to >=3.10 in pyproject.toml.
However, in openml/study/study.py (around lines 151 and 162), there are older developer comments stating: # TODO(eddiebergman): Begging for a walrus if we can drop 3.7.
Since Python 3.7 has indeed been dropped, we can now safely use the walrus operator (:=) to refactor these variable assignments, which cleans up the code and reduces lines.
Expected behavior
The lines assigning content from getattr and checking if content is not None should be combined into a single line using :=. No logical behavior should change; this is purely a code quality refactor to utilize modern Python syntax and resolve the outstanding TODO comments.
- Ngôn ngữ chính
- Python
- Star
- 361
- Fork
- 296
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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 openml/openml-python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
openml/openml-python#1749 ·
-
Documentation Good First Issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
openml/openml-python#1708 · 6 bình luận ·
-
Good First Issue module:Run testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openml/openml-python#1646 · 7 bình luận · 2 reaction ·
-
Good First Issue module:Data testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openml/openml-python#1644 · 4 bình luận ·
-
Documentation
openml/openml-python#1744 · 1 bình luận · 1 người được giao ·
Tất cả issue của openml/openml-python
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 ·