Learning to use yield in Python
The use of the yield expression may be confusing for some, but I hope that with some examples it will be easier to understand.
When you use the yield expression in a function creates a generator function instead of a normal one.
Here there are some e...
paulavieira.hashnode.dev1 min read
Fernando Issao Nissizaki
Dev
Very nice post!! As a Java programmer I was very confusing about Phyton's yield behavior.
In Java we have a yied method within a Thead class and it's tells a thread scheduler that if it wants to pause current thread it seems to be a good time to pause current execution.
Introducing a generator function concept, it seems more clearly to me how it works on runtime.
Great post!