Allow duplicate cut IDs in a CutSet (CutSet is list-like instead of dict-like) #1279
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Despite the title, this is not a breaking API change.
CutSet (and other sets) supported int and str based indexing almost since the start, but int-based indexing was inefficient (it just iterated the dict). Now position based indexing will be more efficient since it's the main usage pattern that I observed.
In addition, this change allows having duplicated cut IDs in the CutSet. Ever since we started introduced lazy manifests, this duplicated IDs were actually implicitly allowed, only as long as the manifest was lazy, since we only checked it for eager manifests. I've seen several use cases now where duplicated IDs are either expected, or at least not harmful - this pops us quite often in anything involving infinite cut sets. I'd rather have duplication checks being explicit in cases where they are required.