75% of Chapter 6

This commit is contained in:
Grant Sanderson
2016-08-10 10:26:07 -07:00
parent 95b7ecb25b
commit 5b60aa0d7c
5 changed files with 338 additions and 29 deletions

View File

@ -454,7 +454,13 @@ class Mobject(object):
raise Exception("Not implemented")
## Family matters
## Family matters
def __getitem__(self, index):
return self.split()[index]
def __iter__(self):
return iter(self.split())
def split(self):
result = [self] if len(self.points) > 0 else []