def test_getslice():
 class l(list, ):
  def __len__(self):
   raise Exception()
 x = l()
 AreEqual(x.__getslice__((-1), (-200)), [])
 class mylist(list, ):
  def __getslice__(self, i, j):
   return (i, j)
 class mylong(long, ):
  pass
 class myint(int, ):
  pass
 for listType in (list, mylist):
  for input in [0, 1, False, True, myint(0), myint(1), mylong(0), mylong(1), (-1), myint((-1)), mylong((-1))]:
   for x in listType(range(5))[input:input]:
    AreEqual(type(x), int)

def test_getslice ( ) : class l ( list , ) : def __len__ ( self ) : raise Exception ( ) x = l ( ) AreEqual ( x . __getslice__ ( ( - 1 ) , ( - 200 ) ) , [ ] ) class mylist ( list , ) : def __getslice__ ( self , i , j ) : return ( i , j ) class mylong ( long , ) : pass class myint ( int , ) : pass for listType in ( list , mylist ) : for input in [ 0 , 1 , False , True , myint ( 0 ) , myint ( 1 ) , mylong ( 0 ) , mylong ( 1 ) , ( - 1 ) , myint ( ( - 1 ) ) , mylong ( ( - 1 ) ) ] : for x in listType ( range ( 5 ) ) [ input : input ] : AreEqual ( type ( x ) , int )
overriding __len__ doesnt get called when doing __getslice__ .