@overload(where)
def overload_where_scalars(cond, x, y):
 if (not isinstance(cond, types.Array)):
  if (x != y):
   raise errors.TypingError('x and y should have the same type')
  def where_impl(cond, x, y):
   '\n            Scalar where() => return a 0-dim array\n            '
   scal = (x if cond else y)
   arr = np.empty_like(scal)
   arr[()] = scal
   return arr
  return where_impl

@ overload ( where ) def overload_where_scalars ( cond , x , y ) : if ( not isinstance ( cond , types . Array ) ) : if ( x != y ) : raise errors . TypingError ( 'x and y should have the same type' ) def where_impl ( cond , x , y ) : scal = ( x if cond else y ) arr = np . empty_like ( scal ) arr [ ( ) ] = scal return arr return where_impl
implement where() for scalars .