On Sun, 10 Jul 2005 16:26:24 -0400,
"Terry Reedy" <[EMAIL PROTECTED]> wrote:

> "Ralf W. Grosse-Kunstleve" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]

> I have a suggestion I don't remember seeing for flagging which vars to 
> autoinit without new syntax: use '_' instead of '.'.  I have never seen 
> local vars with a leading '_'.  So, in combination with whatever other 
> mechanism (metaclass, __init__ decorator?)

>    def __init__(self, _x, y, _z) :

> would automatically do self.x = _x, self.z = _z, but not self.y = y.

> Terry J. Reedy

That's a pretty big change; now all formal parameters beginning with an
underscore have a brand new meaning.

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()

where "self" in "self.x" and "self.y" would have to match the first
parameter (so that the pathological among us could write this:

    def __init__(this, this.x, y, this.z):
        do_something_with_y()

instead).

(Sorry if this posts multiple times; gnus and/or my news server were not
happy when I was composing this reply.)

Regards,
Dan

-- 
Dan Sommers
<http://www.tombstonezero.net/dan/>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to