On 26 April 2017 at 16:17, Erik <pyt...@lucidity.plus.com> wrote: > On 26/04/17 08:59, Paul Moore wrote: >> >> It should be possible to modify the decorator to take a list >> of the variable names you want to assign, but I suspect you won't like >> that > > > Now you're second-guessing me.
Sorry :-) >> class MyClass: >> @auto_args('a', 'b') >> def __init__(self, a, b, c=None): >> pass > > I had forgotten that decorators could take parameters. Something like that > pretty much ticks the boxes for me. Cool. Glad you liked the idea. Paul _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/