Skip to content
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 type hints to mobject/valuetracker.py #4129

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fmuenkel
Copy link
Contributor

Overview: What does this pull request change?

  • Add type hints to valuetracker.py
  • Add error handling for __iadd__() and __isub__()
  • Add __sub__() to solve mypy error for __isub__()
  • Small improvements to docstrings

Motivation and Explanation: Why and how do your changes improve the library?

Related to #3375

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

The value is internally stored as a points array [a, b, 0]. This can be accessed directly
to represent the value geometrically, see the usage example.
"""
def get_value(self) -> complex: # type: ignore [override]
Copy link
Contributor Author

@fmuenkel fmuenkel Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not know how to resolve this.
Between ValueTracker and ComplexValueTracker, the latter makes more sense as the base class not the other way around, but that would be a large re-write.

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.

1 participant