def randiter(iterable):
    '''
Create an iterator that yields random elements from the iterable object 
*iterable*. It expects the iterable object to implement __getitem__ and __len__.'''

    iter_len = len(iterable)

    for index in xrandrange(iter_len):
        yield iterable[index]