def test_slice_setslice_forbidden():
 global setVal
 class foo:
  def __setslice__(self, i, j, value):
   global setVal
   setVal = (i, j, value)
  def __setitem__(self, index, value):
   global setVal
   setVal = (index, value)
 foo()[::None] = 23
 AreEqual(setVal, (slice(None, None, None), 23))
 foo()[::None] = 23
 AreEqual(setVal, (slice(None, None, None), 23))

def test_slice_setslice_forbidden ( ) : global setVal class foo : def __setslice__ ( self , i , j , value ) : global setVal setVal = ( i , j , value ) def __setitem__ ( self , index , value ) : global setVal setVal = ( index , value ) foo ( ) [ : : None ] = 23 AreEqual ( setVal , ( slice ( None , None , None ) , 23 ) ) foo ( ) [ : : None ] = 23 AreEqual ( setVal , ( slice ( None , None , None ) , 23 ) )
providing no value for step forbids calling __setslice__ .