[Python-ideas] Augmented assignment syntax for objects.

Paul Moore p.f.moore at gmail.com
Wed Apr 26 11:22:01 EDT 2017


On 26 April 2017 at 16:17, Erik <python at 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


More information about the Python-ideas mailing list