Skip to content

Fix in place modification of user request dictionary - #98

Merged
awarde96 merged 3 commits into
mainfrom
fix/request-modified-inplace
Sep 2, 2026
Merged

awarde96 merged 3 commits into
mainfrom
fix/request-modified-inplace

Conversation

@andreas-grafberger

Copy link
Copy Markdown
Contributor

Description

While using polytope-mars, I just saw that my passed request dictionary got modified inplace, as some keys get .pop()-ed further down in the code.

What would you think about creating a deepcopy at the top of the PolytopeMars.extract() function? This way, we don't modify the dictionary passed by the user (which they might not suspect). Probably the performance impact of this should be fairly minimal? If these request dictionaries can become quite large where this would be a concern, I'm happy to propose something more performant to fix it.

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

@andreas-grafberger andreas-grafberger changed the title fix: do not modify user request inplace fix: do not modify user request dictionary inplace Mar 26, 2026
@andreas-grafberger andreas-grafberger changed the title fix: do not modify user request dictionary inplace Fix in place modification of user request dictionary Mar 26, 2026

@awarde96 awarde96 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks!

We can either merge after #94 has been merged, or roll this into that PR

@awarde96
awarde96 merged commit 31f5f09 into main Sep 2, 2026
6 checks passed
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.

2 participants