def upcast(*args):
 t = _upcast_memo.get(hash(args))
 if (t is not None):
  return t
 upcast = np.find_common_type(args, [])
 for t in supported_dtypes:
  if np.can_cast(upcast, t):
   _upcast_memo[hash(args)] = t
   return t
 raise TypeError(('no supported conversion for types: %r' % (args,)))

def upcast ( * args ) : t = _upcast_memo . get ( hash ( args ) ) if ( t is not None ) : return t upcast = np . find_common_type ( args , [ ] ) for t in supported_dtypes : if np . can_cast ( upcast , t ) : _upcast_memo [ hash ( args ) ] = t return t raise TypeError ( ( 'no supported conversion for types: %r' % ( args , ) ) )
returns the nearest supported sparse dtype for the combination of one or more types .