[Refactor] Use walrus operator in study.py (Python 3.10+ upgrade)
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 92/100
Research direction
Open openml/study/study.py around lines 151 and 162, where the content assignments, None checks, and outdated walrus TODO comments are located. Combine each assignment and check with the walrus operator, remove the resolved TODO comments, and verify that behavior remains unchanged under the Python 3.10+ requirement.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 361
- Forks
- 296
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openml/openml-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openml/openml-python#1749 ·
-
Documentation Good First Issue
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
openml/openml-python#1708 · 6 comments ·
-
Good First Issue module:Run testing
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
openml/openml-python#1646 · 7 comments · 2 reactions ·
-
Good First Issue module:Data testing
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
openml/openml-python#1644 · 4 comments ·
-
Documentation
openml/openml-python#1744 · 1 comment · 1 assignee ·
All issues in openml/openml-python
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
canonical/paas-charm#368 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
StevenBlack/hosts#3256 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
qualcomm/qai-appbuilder#275 ·