Does Python have equivalent to MATLAB "varargin", "varargout", "nargin", "nargout"?

openopt at ukr.net openopt at ukr.net
Mon Feb 19 02:56:15 EST 2007


Ok, thx
But can I somehow determing how many outputs does caller func require?
for example:
MATLAB:
function [objFunVal firstDerive secondDerive] = simpleObjFun(x)
objFunVal = x^3;
if nargout>1
firstDerive = 3*x^2;
end
if nargout>2
secondDerive = 6*x;
end

So if caller wants only
[objFunVal firstDerive] = simpleObjFun(15)
than 2nd derivatives don't must to be calculated with wasting cputime.
Is something like that in Python?




More information about the Python-list mailing list