If a function has a yield statement somewhere in its body, it is considered to be a generator function. If no yield statement is ever executed, then the function is a generator that produces an empty sequence.
If a function or method body contains the statement 'yield', then it becomes a -generator function-, and invoking the function returns a -generator iterator- instead of a simple value.
Comments 6
...
...it'd help to know the language.
Reply
...
...it'd help to know Python >_>
Reply
Reply
Reply
If a function has a yield statement somewhere in its body, it is considered to be a generator function. If no yield statement is ever executed, then the function is a generator that produces an empty sequence.
Reply
Reply
Leave a comment