Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Change `Union[float, int]` to just `float` according to PEP 484 (#1411)

kamilczerwinski220cd2b85d4a23
diff --git a/manim/mobject/value_tracker.py b/manim/mobject/value_tracker.py
index 927918f52..394be02bf 100644
--- a/manim/mobject/value_tracker.py
+++ b/manim/mobject/value_tracker.py
@@ -3,8 +3,6 @@
__all__ = ["ValueTracker", "ExponentialValueTracker", "ComplexValueTracker"]
-from typing import Union
-
import numpy as np
from ..mobject.mobject import Mobject
@@ -74,21 +72,21 @@ class ValueTracker(Mobject):
"""Get the current value of the ValueTracker. This value changes continuously when :attr:`animate` for the ValueTracker is called."""
return self.points[0, 0]
- def set_value(self, value: Union[float, int]):
+ def set_value(self, value: float):
"""Sets a new scalar value to the ValueTracker"""
self.points[0, 0] = value
return self
- def increment_value(self, d_value: Union[float, int]):
+ def increment_value(self, d_value: float):
"""Increments (adds) a scalar value to the ValueTracker"""
self.set_value(self.get_value() + d_value)
- def __iadd__(self, d_value: Union[float, int]):
+ def __iadd__(self, d_value: float):
"""adds ``+=`` syntax to increment the value of the ValueTracker"""
self.increment_value(d_value)
return self
- def __isub__(self, d_value: Union[float, int]):
+ def __isub__(self, d_value: float):
"""adds ``-=`` syntax to decrement the value of the ValueTracker"""
self.increment_value(-d_value)
return self