|Python Language Reference Manual|
by Guido van Rossum and Fred L. Drake, Jr.
Paperback (6"x9"), 120 pages
RRP £12.95 ($19.95)
Sales of this book support the Python Software Foundation! Get a printed copy>>>
return_stmt "return" [
return may only occur syntactically nested in a function
definition, not within a nested class definition.
If an expression list is present, it is evaluated, else
return leaves the current function call with the expression
None) as return value.
return passes control out of a
finally clause, that
finally clause is executed
before really leaving the function.
In a generator function, the
return statement is not allowed
to include an
expression_list. In that context, a bare
return indicates that the generator is done and will cause
StopIteration to be raised.
|ISBN 0954161785||Python Language Reference Manual||See the print edition|