Skip to content

Commit f2159f7

Browse files
florislayasoob
authored andcommitted
Improve wording in paragraph about StopIteration (yasoob#196)
"wondering that why" does not sound fluid. Also, using the word 'while' in a sentence about a `for` loop may be confusing.
1 parent 5a4f974 commit f2159f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

generators.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ element of a sequence. So let's test out our understanding:
134134
135135
As we can see that after yielding all the values ``next()`` caused a
136136
``StopIteration`` error. Basically this error informs us that all the
137-
values have been yielded. You might be wondering that why don't we get
138-
this error while using a ``for`` loop? Well the answer is simple. The
137+
values have been yielded. You might be wondering why we don't get
138+
this error when using a ``for`` loop? Well the answer is simple. The
139139
``for`` loop automatically catches this error and stops calling
140-
``next``. Do you know that a few built-in data types in Python also
140+
``next``. Did you know that a few built-in data types in Python also
141141
support iteration? Let's check it out:
142142

143143
.. code:: python

0 commit comments

Comments
 (0)