number of arguments a function takes

Aahz aahz at pythoncraft.com
Thu Jan 29 12:04:17 EST 2004


In article <CSaSb.329909$ts4.189798 at pd7tw3no>,
Elaine Jackson <elainejackson7355 at home.com> wrote:
>
>Suppose one of the arguments of a function f_1 is another function
>f_2. Can f_1 access the number of arguments taken by f_2?  (I'm writing
>a little script to automate the construction of logical truth-tables.)

In theory, yes (because of Python's introspection capabilities).  In
practice, you're likely to want to choose a different mechanism that
doesn't require that information.  If you tell us more about your actual
problem, we may be able to point you in a better direction.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"The joy of coding Python should be in seeing short, concise, readable
classes that express a lot of action in a small amount of clear code -- 
not in reams of trivial code that bores the reader to death."  --GvR



More information about the Python-list mailing list