Mobjects now contain submobjects, giving a heirarchy. Thus CompoundMobject is replaced simply with Mobject, and display etc. needed updating

This commit is contained in:
Grant Sanderson
2015-11-02 13:03:01 -08:00
parent 8663bda619
commit 38b07266b9
18 changed files with 491 additions and 457 deletions

View File

@ -11,8 +11,18 @@ import re
from constants import *
def remove_list_redundancies(l):
"""
Used instead of lsit(set(l)) to maintain order
"""
return sorted(list(set(l)), lambda a, b : l.index(a) - l.index(b))
def list_update(l1, l2):
return filter(lambda e : e not in l2, l1) + l2
"""
Used instead of list(set(l1).update(l2)) to maintain order,
making sure duplicates are removed from l1, not l2.
"""
return filter(lambda e : e not in l2, l1) + list(l2)
def all_elements_are_instances(iterable, Class):
return all(map(lambda e : isinstance(e, Class), iterable))