-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add type hints and support for arithmetic operators +
and -
on ValueTracker
#4129
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
Conversation
1ab6b56
to
af88adf
Compare
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.
LGTM! Thanks for these changes!
mobject/valuetracker.py
mobject/valuetracker.py
mobject/value_tracker.py
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.
Sorry - I did not notice the __sub__
method when I approved the PR earlier. I understand that MyPy requires it. However, there is something I have to say about the implementation:
Co-authored-by: Francisco Manríquez Novoa <[email protected]>
Co-authored-by: Francisco Manríquez Novoa <[email protected]>
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.
LGTM! Thanks for the changes!
Now that __sub__
and __add__
is implemented, I noticed that we should do the same for __mul__
, __truediv__
, __floordiv__
, __pow__
and __mod__
, since their inplace counterparts are implemented. Now, since this is mainly a PR for adding type hints, this should be done in a subsequent PR. Would you like to do that PR as well?
Meanwhile, I'll just approve and merge this PR.
Sure, I will have a look at it.. |
mobject/value_tracker.py
+
and -
on ValueTracker
Overview: What does this pull request change?
valuetracker.py
__iadd__()
and__isub__()
__sub__()
to solve mypy error for__isub__()
Motivation and Explanation: Why and how do your changes improve the library?
Related to #3375
Reviewer Checklist