-
-
Save toshok/acdb83ff6bb384eed23b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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