Skip to content

Conversation

@alecksphillips
Copy link
Collaborator

@alecksphillips alecksphillips commented Sep 15, 2022

Making trees immutable might help to avoid some headaches elsewhere; prune, grow, change and swap should return new trees rather than changing the current tree.

Not sure if this is sensible to do or not. It might be sensible to make DiscreteVariables in general immutable for the same reason. It also makes it possible to add a __hash__ function to a class.

@alecksphillips alecksphillips marked this pull request as draft September 15, 2022 15:01
@navjotk
Copy link
Collaborator

navjotk commented Feb 23, 2023

Again, completely agree that immutability is the way to go.

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.

3 participants