On 6/04/21 4:02 am, Terry Reedy wrote:
*Any* use of 'yield' in a function makes the function a generator function. ... If there were a 'dead (unreachable) code' exception, a reader or compiler would have to analyze each use of 'yield' and decide whether it is reachable or not.
It would also break existing code. An unreachable "yield" is sometimes used as a way to get a generator that doesn't yield anything. -- Greg -- https://mail.python.org/mailman/listinfo/python-list