(elements, target_type)
return all(isinstance(elem, target_type) for elem in elements)
Checks that all the given elements are the target type.

  Args:
    elements: A list of objects.
    target_type: The Python class which all elemenets need to be an instance of.

  Returns:
    True if every object in `elements` is an instance of `target_type`, and
    False otherwise.
Checks that all the given elements are the target type.
Checks that all the given elements are the target type .
def _all_are_type(elements, target_type):
  """Checks that all the given elements are the target type.

  Args:
    elements: A list of objects.
    target_type: The Python class which all elemenets need to be an instance of.

  Returns:
    True if every object in `elements` is an instance of `target_type`, and
    False otherwise.
  """
  return all(isinstance(elem, target_type) for elem in elements)
def _all_are_type ( elements , target_type ) : return all ( isinstance ( elem , target_type ) for elem in elements )