Closed
Description
def g():
yield
print(next(g()))
That prints None
, but the Yield expressions documentation doesn't say so. It only talks about "returning the value of expression_list
to the generator’s caller", but doesn't say that None
gets returned if the optional expression_list
isn't given.
Maybe it's stated in the PEPs referenced at the end, but I think one shouldn't have to look that far. It should be right there in the documentation.