Created
January 16, 2019 05:18
-
-
Save niconico25/d0b6d1352a474947da3d4ad50ce6fe22 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 Container: | |
def __iter__(self): | |
return Iterator() | |
class Iterator: | |
def __iter__(self): | |
return self | |
def __next__(self): | |
raise StopIteration | |
for element in Container(): | |
print(element) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment