From: John H. <jdh...@ac...> - 2004-11-15 04:30:14
|
>>>>> "Darren" == Darren Dale <dd...@co...> writes: >> I guess there is no way in Python of emulating Matlab"s >> detection of the number of output arguments. Darren> I just got a response from c.l.p. Somebody remembered Darren> seeing this at ASPN: Darren> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/284742 Darren> expecting() is the workhorse, equivalent to Matlab's Darren> nargout: Darren> import inspect,dis Hi Darren, Wow, I didn't know this was possible in python. Does it work under python2.2? Perhaps you would like to write up nargin and nargout function with some doc strings and send them my way? I could add them to the matlab interface. But we need to make sure they are 2.2 compliant. As an aside, do we need nargout to make "find" work like matlab's? Isn't it enough just to check the shape of the input array and processing it one way for 1D arrays and another way for 2D arrays? Cheers, JDH |