> @mainmethod > def main(...) > > and like this: > > @mainmethod(parser=myparser) > def main(...) > > then you cannot use that decorator for a function that expects or > allows a function as its first argument? Because how and
If it's called with only one non-keyword parameter, then the language might have done it; if not, guaranteed not. (More succintly, if it's not, the language didn't.) So, to get: > @mainmethod > def main(...) you'll have to check the parameter counts, and you can never invoke with just one callable parameter, pretty easy; bulky; your choice between: @mainmethod() def main(...) Note: 'Non-keyword' -and- callable! -- http://mail.python.org/mailman/listinfo/python-list