vector_indexing_suite should implement MutableSequence
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- backend-api-design
Research direction
Start from the vector_indexing_suite implementation and compare its existing methods with the MutableSequence method table in the linked Python documentation. Add insert, reverse, pop, remove, and iadd so the exposed vector satisfies MutableSequence; investigate map_indexing_suite only if its analogous gap is relevant.
Written by the indexing model from the issue text.
Description
Currently vector_indexing_suite implements a few methods that you would expect from list but not all. It means I have to put this type in my_cpp_modules.pyi:
class vector(Iterable[T], Container[T], Sized):
# From indexing_suite
def __len__(self) -> int: ...
def __setitem__(self, index: int, value: T) -> None: ...
def __delitem__(self, index: int) -> None: ...
def __getitem__(self, index: int) -> T: ...
def __contains__(self, value: T) -> bool: ...
def __iter__(self) -> int: ...
# From vector_indexing_suite
def append(self, v: T) -> None: ...
def extend(self, v: Any) -> None: ...
Instead of deriving from Iterable[T], Container[T], Sized it would be much better if it were just a MutableSequence[T]. However that needs a few more methods (see the table at the top of this page):
Specifically:
insertreversepopremove__iadd__
Those methods should be added. It looks like it should be pretty easy.
A similar issue may exist for map_indexing_suite/MutableMapping but I haven't used it yet.
- Dominant language
- C++
- Stars
- 537
- Forks
- 223
- Avg merge
- 11h 22m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
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 boostorg/python
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
BoostDetectToolset-1.90.0.cmake file not found in an include() call in boost_python-config.cmake Open
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
AuTest Bug Tests
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/trafficserver#13714 ·
-
bug build
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
facebookincubator/velox#19143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tenstorrent/tt-metal#57393 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/eo-graphs#74 ·