* George Sakkis wrote: > On Feb 4, 6:53 am, André Malo <[EMAIL PROTECTED]> wrote: >> Consider the function being part of a bigger system, where it's called >> from another function or method which should "inherit" the default value >> of the function, like: >> >> def g(foo, bar, x=None): >> ... >> f(x=x) >> >> Now if you change the default value of f(x) for some reason, you don't >> have to wind up all the possible caller signatures to reflect that >> change. > > You might find handy a decorator I've written exactly for this > scenario, reusing default arguments across functions: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440702
Although it's limited to certain use cases and hence not applicable in all the situations, it's a very nice idea :-) nd -- Winnetous Erbe: <http://pub.perlig.de/books.html#apache2> -- http://mail.python.org/mailman/listinfo/python-list