Skip to content

Instantly share code, notes, and snippets.

@arsatiki
Created June 17, 2009 12:42
Show Gist options
  • Select an option

  • Save arsatiki/131216 to your computer and use it in GitHub Desktop.

Select an option

Save arsatiki/131216 to your computer and use it in GitHub Desktop.
class W(object):
def __init__(self, i):
self.i = iter(i)
def __iter__(self): return self
def next(self): return self.i.next()
def __getslice__(self, start, end):
return islice(self.i, start, end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment