basic implementation of seq in python