Eliminate array resetting loop in _msg_support.c.em
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start with rosidl_generator_py/resource/_msg_support.c.em at lines 589-608 and read the surrounding comment and array-handling code. Compare the available Python APIs against the project's supported Python versions, then verify that the generated message support code resets the array without the existing loop and preserves its behavior.
Written by the indexing model from the issue text.
Description
Description
As comment in the following code suggested, there exists a part of the code that uses a less ideal way to reset the array.
This part can be improved by replacing with either
PyObject * ret = PyObject_CallMethodNoArgs(field, "clear");but this only works with Python 3.13 or higher (reference)PySequence_DelSlice(field, 0, length)that should work in any Python version
Motivation
This is discovered and suggested in a review from PR #250
Design / Implementation Considerations
No response
Additional Information
No response
- Dominant language
- EmberScript
- Stars
- 26
- Forks
- 68
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 1
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 ros2/rosidl_python
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 56/100
ros2/rosidl_python#264 · 2 comments ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
ros2/rosidl_python#257 · 8 comments ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 35/100
ros2/rosidl_python#242 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 32/100
ros2/rosidl_python#219 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ros2/rosidl_python#217 · 2 comments ·
All issues in ros2/rosidl_python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
hemilabs/ui-monorepo#2332 ·
-
Help-Wanted Needs-Triage Package-Update
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/winget-pkgs#438662 ·
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
olcf/olcf-test-harness#278 · 1 comment ·