newbie questions

Steve Holden steve at holdenweb.com
Mon Dec 13 11:36:29 EST 2004


houbahop wrote:

> thanks, very usefull answer.
> 
> 
> 
>>Immutable types (e.g. strings, numbers, tuples) are generally returned 
>>directly from functions, rather than returned as 'output parameters'. The 
>>ability to return multiple values easily (via "return a, b, c" & "x, y, z 
>>= myfunc()" generally eliminates the need for 'by reference' output 
>>parameters as used by C, C++, Java and the like.
>>P.S. If you *really*, *really*, *really* want to fake output parameters, 
>>just wrap them in a list:
> 
> 
>  return multiple values is ok, I usualy use a function only to return one 
> value, for exemple : value=IsSomething(), returning true, to include that in 
> an if statement : if (isSomething(blabla) ) ... but It's not a problem to 
> change that habit. and as I have read somewhere about python : "Explicit is 
> better than implicit"
> 

Plus, as you get more used to Python you'll also get used to thinking of 
a tuple as a single composite object.

regards
  Steve
-- 
Steve Holden               http://www.holdenweb.com/
Python Web Programming  http://pydish.holdenweb.com/
Holden Web LLC      +1 703 861 4237  +1 800 494 3119



More information about the Python-list mailing list