-
Notifications
You must be signed in to change notification settings - Fork 993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add immutable var class #3607
add immutable var class #3607
Conversation
adhami3310
commented
Jul 2, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs an overridden _replace
method that returns ImmutableVar
instances.
it actually might make sense to override create
as well to something like this
@classmethod
def create(self, ...):
return super().create(...)._replace()
That way we can create ImmutableVar
instances in the same way as Var
instances until more special-case behavior is added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can hold off on adding tests for now, because most of the API for ImmutableVar
is coming from Var
itself and won't represent the final usage of the API.
but in a near-future PR, we will want to make sure these changes are coming in with near-full test coverage, because it's much easier to add tests incrementally, rather than at the end.