On 2007-09-12, Michele Simionato <[EMAIL PROTECTED]> wrote:
>> I see the argument for making self explicit -- what would be
>> wrong with just .a instead of self.a though?  That's still
>> explicit but much easier to read.  (I think I've seen that
>> somewhere else, is it C#?)
>
> This has been proposed many times. But self is handy because
> you can give a different name to it: for instance it becomes
> cls when you are inside a classmethod.

The treatment of self in the function's parameter list seems to
be the pitfall of any .member shortcut proposal. Most proposals
don't even address that point.

Does it become:

class Foo:
  def __init__():
    .bar = 40

or

class Foo:
  def __init__(.):
    .bar = 40

or

class Foo:
  def __init__(self):
    .bar = 40

I guess the middle one is the most consistent, but it seems
ugly compared to what we have now.

-- 
Neil Cerutti
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to