--aer--
2/27/2018 - 10:14 AM

is_all_type helper for python


def is_all_type(t, ttype):
  """ Helper to check if given 't' is a 'ttype' or list of 'ttype' """
  
  tlist = lambda l: all(map(lambda t: isinstance(t, ttype), l))
  return isinstance(t, ttype) or tlist(t)