Added Mobject.update capabilties, which should be nicer and lighter weight than using ContinualUpdateFromFunc all the time. Also changed the behavior of any Animation having its mobject automatically thrust up to the front of the screen

This commit is contained in:
Grant Sanderson
2018-08-12 12:17:32 -07:00
parent a72ce98f5e
commit 5b5a83b316
5 changed files with 97 additions and 28 deletions

View File

@ -1,5 +1,6 @@
import numpy as np
import operator as op
import inspect
from functools import reduce
@ -16,6 +17,10 @@ def choose(n, r):
numer = reduce(op.mul, range(n, n - r, -1), 1)
return numer // denom
def get_num_args(function):
return len(inspect.signature(function).parameters)
# Just to have a less heavyweight name for this extremely common operation
#
# We may wish to have more fine-grained control over division by zero behavior