#NEWLINE# def __setitem__( self , index , value ) : #NEWLINE# #INDENT# if ( not isinstance ( index , slice ) ) : #NEWLINE# #INDENT# self . _set ( self . col [ index ] , value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( index . stop is None ) : #NEWLINE# #INDENT# stop = len ( self ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( index . stop < 0 ) : #NEWLINE# #INDENT# stop = ( len ( self ) + index . stop ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# stop = index . stop #NEWLINE# #UNINDENT# #UNINDENT# step = ( index . step or 1 ) #NEWLINE# start = ( index . start or 0 ) #NEWLINE# rng = list ( range ( ( index . start or 0 ) , stop , step ) ) #NEWLINE# if ( step == 1 ) : #NEWLINE# #INDENT# for i in rng : #NEWLINE# #INDENT# del self [ start ] #NEWLINE# #UNINDENT# i = start #NEWLINE# for item in value : #NEWLINE# #INDENT# self . insert ( i , item ) #NEWLINE# i += 1 #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( value ) != len ( rng ) ) : #NEWLINE# #INDENT# raise ValueError ( ( 'attempt to assign sequence of size %s to extended slice of size %s' % ( len ( value ) , len ( rng ) ) ) ) #NEWLINE# #UNINDENT# for ( i , item ) in zip ( rng , value ) : #NEWLINE# #INDENT# self . _set ( self . col [ i ] , item )