# HG changeset patch # User Greg Malcolm # Date 1296953044 18000 # Sat Feb 05 19:44:04 2011 -0500 # Node ID 2efacb8b49f86e88961b94664abc5300c45a2acc # Parent e2fff7510f4577a3f7cbc68158fd7815d924fce3 From icmurry, github: Fixed issue: https://github.com/gregmalcolm/python_koans/issues#issue/2 (sum_it uninteresting) Made the change detailed in the ticket, namely bringing value into the loop, making it more obvious that the state of value is retained between iterations. diff --git a/python 2/koans/about_generators.py b/python 2/koans/about_generators.py --- a/python 2/koans/about_generators.py +++ b/python 2/koans/about_generators.py @@ -81,7 +81,7 @@ for num in seq: # The local state of 'value' will be retained between iterations value += num - yield value + yield value def test_generator_keeps_track_of_local_variables(self): result = self.sum_it(range(2,5)) diff --git a/python 3/koans/about_generators.py b/python 3/koans/about_generators.py --- a/python 3/koans/about_generators.py +++ b/python 3/koans/about_generators.py @@ -84,7 +84,7 @@ for num in seq: # The local state of 'value' will be retained between iterations value += num - yield value + yield value def test_generator_keeps_track_of_local_variables(self): result = self.sum_it(range(2,5))