class IGottaTestThis:
    def __getitem__(self, arg):
        print arg
        return len(arg)
    def __setitem__(self, loc, val):
        print loc
        print val
        raise IndexError, "where exactly is that?"

def test():
    l = range(1, 10)
    try:
        print l[2:3:2]
    except TypeError:
        print "this is a little odd"
    print l[-3:-1]
    print l[:]
    l[2] = -2
    print l[:3]
    l[2:3] = [0, 0]
    print l[:4]
    del l[4:6]
    print l

    obj = IGottaTestThis()
    print obj[5:10:-5, ..., 1:3:6]
    try:
        obj[5:10:-5, ..., 1:3:6] = 4, 5
    except IndexError:
        print "didn't think it would work anyway"
    
test()
