def get_numeric_subclasses(cls=numpy.number, ignore=None):
 if (ignore is None):
  ignore = []
 rval = []
 dtype = numpy.dtype(cls)
 dtype_num = dtype.num
 if (dtype_num not in ignore):
  numpy.array(0, dtype=dtype)
  rval.append(cls)
  ignore.append(dtype_num)
 for sub in cls.__subclasses__():
  rval += [c for c in get_numeric_subclasses(sub, ignore=ignore)]
 return rval

def get_numeric_subclasses ( cls = numpy . number , ignore = None ) : if ( ignore is None ) : ignore = [ ] rval = [ ] dtype = numpy . dtype ( cls ) dtype_num = dtype . num if ( dtype_num not in ignore ) : numpy . array ( 0 , dtype = dtype ) rval . append ( cls ) ignore . append ( dtype_num ) for sub in cls . __subclasses__ ( ) : rval += [ c for c in get_numeric_subclasses ( sub , ignore = ignore ) ] return rval
return subclasses of cls in the numpy scalar hierarchy .