Skip to content

Commit b1c7361

Browse files
kjcmpirnat
authored andcommitted
about_generators: Renamed generator_with_coroutine and test.
generator_with_coroutine is really just a simple coroutine. Renamed to just: coroutine. test_generators_can_take_coroutines renamed to slightly more descriptive: test_generators_can_act_as_coroutines.
1 parent 6ebf5b6 commit b1c7361

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

python2/koans/about_generators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ def test_generator_keeps_track_of_local_variables(self):
9191

9292
# ------------------------------------------------------------------
9393

94-
def generator_with_coroutine(self):
94+
def coroutine(self):
9595
result = yield
9696
yield result
9797

98-
def test_generators_can_take_coroutines(self):
99-
generator = self.generator_with_coroutine()
98+
def test_generators_can_act_as_coroutines(self):
99+
generator = self.coroutine()
100100

101101
# THINK ABOUT IT:
102102
# Why is this line necessary?
@@ -108,7 +108,7 @@ def test_generators_can_take_coroutines(self):
108108
self.assertEqual(__, generator.send(1 + 2))
109109

110110
def test_before_sending_a_value_to_a_generator_next_must_be_called(self):
111-
generator = self.generator_with_coroutine()
111+
generator = self.coroutine()
112112

113113
try:
114114
generator.send(1 + 2)

python3/koans/about_generators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ def test_generator_keeps_track_of_local_variables(self):
9292

9393
# ------------------------------------------------------------------
9494

95-
def generator_with_coroutine(self):
95+
def coroutine(self):
9696
result = yield
9797
yield result
9898

99-
def test_generators_can_take_coroutines(self):
100-
generator = self.generator_with_coroutine()
99+
def test_generators_can_act_as_coroutines(self):
100+
generator = self.coroutine()
101101

102102
# THINK ABOUT IT:
103103
# Why is this line necessary?
@@ -109,7 +109,7 @@ def test_generators_can_take_coroutines(self):
109109
self.assertEqual(__, generator.send(1 + 2))
110110

111111
def test_before_sending_a_value_to_a_generator_next_must_be_called(self):
112-
generator = self.generator_with_coroutine()
112+
generator = self.coroutine()
113113

114114
try:
115115
generator.send(1+2)

0 commit comments

Comments
 (0)