Fix a bug

Should add return to double_numbers function, without it next expression wiil fall with "TypeError: 'NoneType' object is not iterable" error
for value in double_numbers(range(1000000)):  # `test_non_generator`
    print value
    if value > 5:
        break
This commit is contained in:
Smosker 2016-11-15 16:10:56 +04:00 committed by GitHub
parent 809e5d20a9
commit ac6d64168f

View File

@ -692,6 +692,7 @@ def double_numbers(iterable):
double_arr = []
for i in iterable:
double_arr.append(i + i)
return double_arr
# Running the following would mean we'll double all values first and return all
# of them back to be checked by our condition