Yield after the return in Python function.

Bischoop Bischoop at vimart.net
Mon Apr 5 08:25:55 EDT 2021


The return suspends the function execution so how is it that in below
example I got output: <generator object doit at 0x7f57fd2912e0>

def doit():
    return 0
    yield 0
    
print(doit())





More information about the Python-list mailing list