From: Darren D. <dd...@co...> - 2004-11-16 01:23:18
|
John Hunter wrote: >>>>>>"Chris" == Chris Barker <Chr...@no...> writes: >>>>>> >>>>>> > > > Chris> no, I was a bit wrong. Python functions always return one > Chris> object, and when it appears that you are returning multiple > Chris> objects, you are really returning a single tuple with > Chris> multiple objects in it. Have I got it right this time? > >Sounds right to me. Your answer does point to the danger of using >nargout in python > > ret = somefunc() > i,j = ret > >If somefunc is relying on nargout, it will botch it. > >I think the only sane use for nargout in python is in auto-conversion >scripts, and then with appropriate warnings. > >Thanks said, I would still like to have it, for that reason. > > Matlab also returns one object- the varargout cell array which is similar to Python's list or tuple. You write a function, and pack varargout with nargout results: [a,b]=matlabfun(). |