#NEWLINE# @ lower_builtin ( 'delitem' , types . List , types . SliceType ) #NEWLINE# def setitem_list( context , builder , sig , args ) : #NEWLINE# #INDENT# inst = ListInstance ( context , builder , sig . args [ 0 ] , args [ 0 ] ) #NEWLINE# slice = context . make_helper ( builder , sig . args [ 1 ] , args [ 1 ] ) #NEWLINE# slicing . guard_invalid_slice ( context , builder , sig . args [ 1 ] , slice ) #NEWLINE# inst . fix_slice ( slice ) #NEWLINE# slice_len = slicing . get_slice_length ( builder , slice ) #NEWLINE# zero = ir . Constant ( slice_len . type , 0 ) #NEWLINE# one = ir . Constant ( slice_len . type , 1 ) #NEWLINE# with builder . if_then ( builder . icmp_signed ( '!=' , slice . step , one ) , likely = False ) : #NEWLINE# #INDENT# msg = 'unsupported del list[start:stop:step] with step != 1' #NEWLINE# context . call_conv . return_user_exc ( builder , NotImplementedError , ( msg , ) ) #NEWLINE# #UNINDENT# start = slice . start #NEWLINE# real_stop = builder . add ( start , slice_len ) #NEWLINE# tail_size = builder . sub ( inst . size , real_stop ) #NEWLINE# inst . move ( start , real_stop , tail_size ) #NEWLINE# inst . resize ( builder . sub ( inst . size , slice_len ) ) #NEWLINE# return context . get_dummy_value ( )