all_type

Stoner.tools.all_type(iterator: Iterable, typ: type) bool[source]

Determine if an interable omnly contains a common type.

Parameters:
  • iterator (Iterable) – The object to check if it is all iterable

  • typ (class) – The type to check for.

Returns:

True if all elements are of the type typ, or False if not.

Notes

Routine will iterate the iterator and break when an element is not of the search type typ.