def test_slice_getslice_forbidden():
 class foo:
  def __getslice__(self, i, j):
   return 42
  def __getitem__(self, index):
   return 23
 AreEqual(foo()[::None], 23)
 AreEqual(foo()[::None], 23)

def test_slice_getslice_forbidden ( ) : class foo : def __getslice__ ( self , i , j ) : return 42 def __getitem__ ( self , index ) : return 23 AreEqual ( foo ( ) [ : : None ] , 23 ) AreEqual ( foo ( ) [ : : None ] , 23 )
providing no value for step forbids calling __getslice__ .