Disallow adding Implementation objects from a different Alternatives set#9
Merged
Code0x58 merged 2 commits intoMay 9, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 199 202 +3
=========================================
+ Hits 199 202 +3 ☔ View full report in Codecov by Sentry. |
Owner
Author
|
This is a bit pedantic, probably based on the idea that alternatives are functionally identical, and do different Alternative collections are naturally not identical. If this case is encountered then hopefully it is an error, or an indication that two sets of alternatives are the same and so would be good to unify. If not, well, hello - there should be some workarounds but feel free to drop a comment here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Implementationinstances between differentAlternativessets by surfacing an explicit error instead of silently accepting or incorrectly cloning them.Description
CrossAlternativesImplementationfor this specific error case.Alternatives.add, raiseCrossAlternativesImplementationwhen anImplementationbeing added belongs to a differentAlternativesinstance.Implementationfrom another alternatives set and add a dedicatedtest_cross_owner_add_errorthat asserts the exception and its message.Testing
pytest test_alternative.py::test_add_from_other_alternativesandpytest test_alternative.py::test_cross_owner_add_error, and both tests passed.test_alternative.pywithpytestand observed the updated tests succeeded.Codex Task