Skip to content

Instantly share code, notes, and snippets.

@toshok
Created May 13, 2015 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toshok/acdb83ff6bb384eed23b to your computer and use it in GitHub Desktop.
Save toshok/acdb83ff6bb384eed23b to your computer and use it in GitHub Desktop.
class Iterable(object):
def __iter__(self):
return self
def __hasnext__(self):
False
def next(self):
raise StopIteration()
class IterableSub(Iterable):
pass
def do_iter(r):
for i in r:
pass
f = 0
while f < 10000:
f += 1
do_iter(Iterable())
do_iter(IterableSub())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment