
On 25 April 2017 at 22:27, Mike Miller <python-ideas@mgmiller.net> wrote:
On 2017-04-25 14:15, Brice PARENT wrote:
But, any of these proposals, mine and yours, if you really need this to shorten the code writing time or vertical space only, is not a better idea than to propose a macro to your IDE editor, or a pull request if it's open source. Such a macro would generate automatically those long-to-write lines, and maybe implement some code folding if vertical space is an issue.
I'm personally not bothered by vertical space, but rather typing the same thing three times with self's and ='s. That's more boilerplate than Java. ;)
Well, class MyClass: @auto_args def __init__(self, a, b, c=None): pass seems ideal for you then (using the auto_args decorator from https://twitter.com/judy2k/status/854330478068977664 - a 13-line function including the import of inspect and some comments). (Arguing for auto_args to be in the stdlib may be a better option than arguing for new syntax, BTW...) Paul