"Dick Moores" <[EMAIL PROTECTED]> wrote
> And if the function is rewritten as def fact(n, full=False,
> precision=15)
> there would be the analogous problem involving full.
>
> Is there a way to solve this problem of the unnecessary setting of
> the 2nd argument?
The most common solution I've seen is to write wrappers
around the basic function like:
def fullFact(n, precision=15):
return fact(n,True,precision)
def precisionFact(n, full=False):
return fact(n, full, 15)
Not terribly elegant but is at least short and simple.
--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor