Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 28, 2025

Addresses request to verify cleanup code for std::deque support works correctly for mutable reference parameters.

Changes

  • C++ test functions: Added doubleDequeElements(std::deque<int>&) and doubleListElements(std::list<double>&) to test mutable reference handling
  • Python tests: Verify that modifications made in C++ are properly synced back to Python lists via cleanup code

Cleanup code behavior

For std::deque, uses indexed access:

d[:] = [<int>v0.at(i) for i in range(v0.size())]

For std::list, uses iterator traversal:

l[:] = []
cdef libcpp_list[double].iterator it = v0.begin()
while it != v0.end():
   l.append(deref(it))
   inc(it)

All 77 tests pass. Deque support retained as cleanup code functions correctly.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 28, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI changed the title [WIP] Add C++17 STL container converters Add tests for std::deque and std::list mutable reference cleanup code Nov 28, 2025
@timosachsenberg timosachsenberg marked this pull request as ready for review November 28, 2025 13:03
@timosachsenberg timosachsenberg merged commit 1a2874e into stl17_support Nov 28, 2025
12 of 16 checks passed
@jpfeuffer
Copy link
Contributor

@timosachsenberg but tests failed?

timosachsenberg added a commit that referenced this pull request Nov 28, 2025
* Add C++17 STL container converters

Add converters for modern STL containers:
- std::unordered_map<K,V> -> Python dict
- std::unordered_set<T> -> Python set
- std::deque<T> -> Python list
- std::list<T> -> Python list
- std::optional<T> -> Python T | None
- std::string_view -> Python bytes/str

Update default C++ standard from C++11 to C++17 for compilation.
Fix converter architecture to handle None values for std::optional.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Add tests for std::deque and std::list mutable reference cleanup code (#207)

* Initial plan

* Add tests for std::deque and std::list mutable reference cleanup code

Co-authored-by: timosachsenberg <[email protected]>

* Run code review and codeql checks

Co-authored-by: timosachsenberg <[email protected]>

* Remove CodeQL artifact and update gitignore

Co-authored-by: timosachsenberg <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: timosachsenberg <[email protected]>
Co-authored-by: Timo Sachsenberg <[email protected]>

* Initial plan

* Fix bytes parameter type to untyped for string_view wrappers

Co-authored-by: timosachsenberg <[email protected]>

* Update Cython requirement to version 3.1

* nested and mixed

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Samuel Wein <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants