__autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

Kay Schluehr kay.schluehr at gmx.net
Mon Jul 11 07:28:28 CEST 2005


Dan Sommers schrieb:

> How about this:
>
>     def __init__(self, self.x, y, self.z):
>         # self.x, self.z from first and third explicit parameters
>         do_something_with_y()

Can you tell me in which way it is anyhow better than the original
proposal

     def __init__(self, .x, y, .z):
          # self.x, self.z from first and third explicit parameters
          do_something_with_y()

besides that it is more verbose? 

Kay




More information about the Python-list mailing list