Up to associativity in EoLA chapter 4

This commit is contained in:
Grant Sanderson
2016-07-28 11:16:28 -07:00
parent 418e11fd66
commit 8e48140961
5 changed files with 766 additions and 11 deletions

View File

@ -133,6 +133,9 @@ def list_update(l1, l2):
"""
return filter(lambda e : e not in l2, l1) + list(l2)
def list_difference_update(l1, l2):
return filter(lambda e : e not in l2, l1)
def all_elements_are_instances(iterable, Class):
return all(map(lambda e : isinstance(e, Class), iterable))