Fixed (most) uses of cmp functions for sorting

This commit is contained in:
Grant Sanderson
2018-08-12 12:57:38 -07:00
parent 7f3b1e624d
commit b04bddf35b
10 changed files with 29 additions and 23 deletions

View File

@ -829,10 +829,7 @@ class Mobject(Container):
def sort_submobjects(self, point_to_num_func=lambda p: p[0]):
self.submobjects.sort(
lambda *mobs: cmp(*[
point_to_num_func(mob.get_center())
for mob in mobs
])
key=lambda m: point_to_num_func(mob.get_center())
)
return self