What's the difference between generating a value and returning a value?

Alan G Isaac alan.isaac at gmail.com
Mon Mar 23 18:38:45 EDT 2009


On 3/23/2009 6:12 PM grocery_stocker apparently wrote:
> http://openbookproject.net/thinkCSpy/ch05.xhtml#index15
> 
> "The built-in functions we have used, such as abs,
> pow, and max, have produced results.  Calling each of
> these functions generates a value, which we usually assign to a
> variable or
> use as part of an expression.
> 
> 
> biggest = max(3, 7, 2, 5)
> x = abs(3 - 11) + 10
> 
> But so far, none of the functions we have written has returned a
> value.



I do not think this distinction is intended.
The key point is that the user-*written* functions
up to then do not include and explicit return statement.
(Actually, they still return None, which can in fact
be bound to a name.)

However it might (?) be that they are trying to
allow that some callable objects are not function types.
(E.g., creating an instance by calling the class,
which some of the builtins do.)  If so, this terminology
would not be a standard way of making that distinction.

Alan Isaac
(*not* a CS type)



More information about the Python-list mailing list