Agreed with Steven, although I do find myself a little more annoyed and bothered by a typical init than him I guess.

Even so I didn't think the current proposals went far enough. To tilt the balance farther, to make it easier, let's go all the way! Instead of continuing duplication:

>>> def __init__(self, foo, bar, baz, spam, ham):
  self .= foo, bar, baz, spam, ham

or

# object member assignment
self .= foo .= bar .= baz .= spam .= ham

How about?

    def __init__(self, foo, bar, baz, spam, ham):
      self .= *

The asterisk here used to be reminiscent of argument unpacking (minus self). That would imply a double asterisk for keyword assignment which could be used as well.

Also, I did find the decorator proposal intriguing, though have to say I probably wouldn't bother to use it unless it were a builtin or I had a dozen parameters to deal with.

-Mike
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to