Skip to content

Enforce unique, nonempty labels for outcomes - #982

Merged
tturocy merged 6 commits into
gambitproject:masterfrom
d-kad:outcome-labels
Jul 10, 2026
Merged

Enforce unique, nonempty labels for outcomes#982
tturocy merged 6 commits into
gambitproject:masterfrom
d-kad:outcome-labels

Conversation

@d-kad

@d-kad d-kad commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Issues closed by this PR

Description of the changes in this PR

Enforces label rules for outcomes, following the same pattern as players (#979) and strategies (#981).

An outcome label must be nonempty, valid, and unique within the game, enforced in GameRep::CheckOutcomeLabel, called at creation (NewOutcome) and relabel (SetLabel);
violations raise ValueError. add_outcome requires a label and relies on the C++ enforcement;
a failed creation with an invalid or duplicate label leaves the game unchanged.

@d-kad d-kad added this to the gambit-16.7.0 milestone Jul 8, 2026
@d-kad d-kad added c++ Items which involve writing in C++ cython Items which involve coding in Cython labels Jul 8, 2026
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@tturocy
tturocy merged commit 6e5a8bd into gambitproject:master Jul 10, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Items which involve writing in C++ cython Items which involve coding in Cython

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants