Attack a sacred Python Cow

Russ P. Russ.Paielli at gmail.com
Sat Jul 26 21:48:33 CEST 2008


> If, as I wrote, you permit the omission of "self" in method signatures
> defined within class definitions, then you could still insist on
> instance attribute qualification using "self" - exactly as one would
> when writing Java according to certain style guidelines.

I'm not sure exactly what people mean here by allowing "self" to be
"omitted" in method signatures. If it is omitted, then it seems to me
that a place holder would be needed to the interpreter that the first
argument is not just another name for "self."

In an earlier post on this thread (don't feel like looking it up at
the moment), someone suggested that member data could be accessed
using simply ".member". I think he might be on to something. The dot
is a minimal indicator that the data is a class member rather than
just local. However, a placeholder is still needed in the signature.

So why not allow something like this?:

class MyClass:

    def func( , xxx, yyy):

        .xxx = xxx

        local = .yyy

The "self" argument is replaced with nothing, but a comma is used as a
placeholder.




More information about the Python-list mailing list