Skip to content

Instantly share code, notes, and snippets.

@niconico25
Created January 16, 2019 05:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niconico25/d0b6d1352a474947da3d4ad50ce6fe22 to your computer and use it in GitHub Desktop.
Save niconico25/d0b6d1352a474947da3d4ad50ce6fe22 to your computer and use it in GitHub Desktop.
# 対話モード >>> に
# コピペで実行できます。
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