Skip to content

Fix OrderedNamespaceSet.__setitem__ slice assigns exhausted iterator#516

Open
zrgt wants to merge 1 commit intoeclipse-basyx:developfrom
rwth-iat:fix/b1-ordered-namespaceset-setitem-slice
Open

Fix OrderedNamespaceSet.__setitem__ slice assigns exhausted iterator#516
zrgt wants to merge 1 commit intoeclipse-basyx:developfrom
rwth-iat:fix/b1-ordered-namespaceset-setitem-slice

Conversation

@zrgt
Copy link
Copy Markdown
Contributor

@zrgt zrgt commented May 5, 2026

Summary

In OrderedNamespaceSet.__setitem__ slice branch, the code stored the exhausted islice iterator back into self._order[s] instead of the already-materialized successful_new_items list. Python evaluates the iterator during slice assignment, gets nothing (already consumed), so all new items were silently dropped from the ordering while still being present in the NamespaceSet backends — leaving the set in an inconsistent state.

Fix: self._order[s] = successful_new_items.

Fixes #494

Test plan

  • test_ordered_namespaceset_slice_setitem_preserves_order — replace 2-item slice, verify new items appear in correct positions
  • Full test.model.test_base suite passes

slice branch stored exhausted islice iterator back into _order instead
of the materialized successful_new_items list, resulting in an empty
slice assignment that discarded all newly added items.

Fixes eclipse-basyx#494
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.

1 participant