Python function returns:

Roy Smith roy at panix.com
Thu May 4 08:57:00 EDT 2006


In article <mailman.5325.1146746746.27775.python-list at python.org>,
 Tim Chase <python.list at tim.thechases.com> wrote:

> They Python way (that you deride) is much clearer.  Your 
> input goes in the parameters, and your output gets assigned 
> the way functions are intended to work.  Unambiguous.

It's probably worth mentioning that the only reason C/C++ uses pointer 
arguments to return multiple values is because in the early versions of C, 
a function could not return a struct, so passing in pointers was the only 
way to return multiple values.

Don't turn something which was forced upon us by a historical compiler 
limitation into something you want to emulate in other langauges which have 
better solutions to the problem.



More information about the Python-list mailing list