Skip to content

Commit 6062b43

Browse files
committed
Fix formatting in README for generator function explanation
1 parent c7133b6 commit 6062b43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python_utils/yield/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Yield
22
- Yield is a fairly simple statement. Its primary job is to control the flow of a generator function in a way that’s similar to return statements.
3-
- When you call a generator function or use a generator expression, you return a special iterator called a generator. You can assign this generator to a variable in order to use it. When you call special methods on the generator, such as next(), the code within the function is executed up to yield.
3+
- When you call a generator function or use a generator expression, you return a special iterator called a generator. You can assign this generator to a variable in order to use it. When you call special methods on the generator, such as `next()`, the code within the function is executed up to yield.
44
- When the Python yield statement is hit, the program suspends function execution and returns the yielded value to the caller. When a function is suspended, the state of that function is saved. This includes any variable bindings local to the generator, the instruction pointer, the internal stack, and any exception handling.
55

66

0 commit comments

Comments
 (0)