|
From: Andrew S. <str...@as...> - 2005-05-24 15:05:20
|
phi...@ho... wrote: > Hi list, > > The program i have to create must let users give lots of paremeters for > functions. > But he can only specify some and the program must adapt to complete by > default settings the ones missing. > It is a way for python to compensate the lack of overload for methods in > oo. > > I go through pylab.py code and although it is new to me, i have the > intuition you are using it. > Is Matplotlib using the concept of partial application? Yes, pylab does this, although I've never heard default arguments called a "concept of partial application." I might suggest that pylab's handling of arguments is rather elaborate for a newbie with its heavy use of *args and **kwargs and nested call structures, but don't let that stop you! :) In case you haven't seen it, check out the relevant part of the tutorial: "More on Defining Functions" http://docs.python.org/tut/node6.html#SECTION006700000000000000000 Cheers! Andrew |