View difference between Paste ID: 80UJuZfa and BffEwwPP
SHOW: | | - or go back to the newest paste.
1
class Foo():
2
	a = 1
3
	b = 2
4
	c = 42
5
	d = ['hello', 'world']
6
7
	def __iter__(self):
8
		yield self.a
9
		yield self.b
10
		yield self.c
11
		yield from self.d
12
13
14
f = Foo()
15
for x in f:
16
	print(x)
17
18
# Should print the following:
19
# 1
20
# 2
21
# 42
22
# 'hello'
23
# 'world'