Re: Incorrect number of arguments

2005-06-09 Thread Andrew Dalke
Steven D'Aprano wrote: > *eureka moment* > > I can use introspection on the function directly to see > how many arguments it accepts, instead of actually > calling the function and trapping the exception. For funsies, the function 'can_call' below takes a function 'f' and returns a new function

Re: Incorrect number of arguments

2005-06-08 Thread Steven D'Aprano
Steven D'Aprano wrote: > I worked around this problem by predicting what error message to expect > given N expected arguments and M supplied arguments. Yuck: this is a > messy, inelegant, ugly hack :-( Thank goodness that functions are first > class objects that support introspection :-) *eure