def assert_all_instances(list_, class_, label='object'):
 for obj in (list_ or []):
  assert_instance(obj, class_, label='object')

def assert_all_instances ( list_ , class_ , label = 'object' ) : for obj in ( list_ or [ ] ) : assert_instance ( obj , class_ , label = 'object' )
raises argumenterror when objects in list_ are not instances of cls .