Make Node.infoset, Node.outcome, Node.player lazy, node-anchored views (#946)#962
Merged
Merged
Conversation
tturocy
requested changes
Jun 25, 2026
tturocy
requested changes
Jun 29, 2026
tturocy
left a comment
Member
There was a problem hiding this comment.
This looks positive, so let's proceed with .outcome and .player as discussed and combine them into one atomic change.
Node.infoset a lazy, node-anchored view (#946)Node.infoset, Node.outcome, Node.player lazy, node-anchored views (#946)
tturocy
approved these changes
Jul 1, 2026
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.
Closes #946
Description of the changes in this PR
Makes three node properties —
Node.infoset,Node.outcome, andNode.player— returnlazy, node-anchored views (
NodeInfoset,NodeOutcome,NodePlayer) that resolve on eachaccess rather than capturing a value at access time. A stored reference now tracks game
mutations and re-resolves to reflect the current tree, consistent with the already-lazy
Node.children.Each view resolves to
None(and is falsy) when the relation is absent: a terminal node hasno infoset and no player; same for a node with no attached outcome. At a chance node,
Node.playerresolves to the chance player (is_chanceisTrue).Node.parentremains eager as agreed.Notes
resolve().Infoset.__eq__,Outcome.__eq__, andPlayer.__eq__now returnNotImplementedon typemismatch (was plain
False), so a real object and its view compare equal from either side.