Skip to content

Commit ba6b812

Browse files
committed
Added a "THINK ABOUT IT" comment to the section on sending values into generators.
Added to both Python2 and Python3 koans.
1 parent 0dd9acb commit ba6b812

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

python 2/koans/about_generators.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,14 @@ def generator_with_coroutine(self):
9595

9696
def test_generators_can_take_coroutines(self):
9797
generator = self.generator_with_coroutine()
98+
99+
# THINK ABOUT IT:
100+
# Why is this line necessary?
101+
#
102+
# Hint: Read the "Specification: Sending Values into Generators"
103+
# section of http://www.python.org/dev/peps/pep-0342/
98104
next(generator)
105+
99106
self.assertEqual(__, generator.send(1 + 2))
100107

101108
# ------------------------------------------------------------------
@@ -116,4 +123,4 @@ def test_generators_can_see_if_they_have_been_called_with_a_value(self):
116123
next(generator2)
117124
self.assertEqual(__, next(generator2))
118125

119-
126+

python 3/koans/about_generators.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,14 @@ def generator_with_coroutine(self):
9898

9999
def test_generators_can_take_coroutines(self):
100100
generator = self.generator_with_coroutine()
101+
102+
# THINK ABOUT IT:
103+
# Why is this line necessary?
104+
#
105+
# Hint: Read the "Specification: Sending Values into Generators"
106+
# section of http://www.python.org/dev/peps/pep-0342/
101107
next(generator)
108+
102109
self.assertEqual(__, generator.send(1 + 2))
103110

104111
# ------------------------------------------------------------------

0 commit comments

Comments
 (0)