mirror of
https://github.com/3b1b/manim.git
synced 2025-07-30 21:44:19 +08:00
Mobjects now contain submobjects, giving a heirarchy. Thus CompoundMobject is replaced simply with Mobject, and display etc. needed updating
This commit is contained in:
12
helpers.py
12
helpers.py
@ -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))
|
||||
|
Reference in New Issue
Block a user