@lower_builtin('getitem', types.Buffer, types.Array)
def fancy_getitem_array(context, builder, sig, args):
 (aryty, idxty) = sig.args
 (ary, idx) = args
 ary = make_array(aryty)(context, builder, ary)
 if (idxty.ndim == 0):
  (idxty, idx) = normalize_index(context, builder, idxty, idx)
  res = _getitem_array_generic(context, builder, sig.return_type, aryty, ary, (idxty,), (idx,))
  return impl_ret_borrowed(context, builder, sig.return_type, res)
 else:
  return fancy_getitem(context, builder, sig, args, aryty, ary, (idxty,), (idx,))

@ lower_builtin ( 'getitem' , types . Buffer , types . Array ) def fancy_getitem_array ( context , builder , sig , args ) : ( aryty , idxty ) = sig . args ( ary , idx ) = args ary = make_array ( aryty ) ( context , builder , ary ) if ( idxty . ndim == 0 ) : ( idxty , idx ) = normalize_index ( context , builder , idxty , idx ) res = _getitem_array_generic ( context , builder , sig . return_type , aryty , ary , ( idxty , ) , ( idx , ) ) return impl_ret_borrowed ( context , builder , sig . return_type , res ) else : return fancy_getitem ( context , builder , sig , args , aryty , ary , ( idxty , ) , ( idx , ) )
advanced or basic indexing with an array .