Self Nanny

Lloyd Zusman ljz at asfast.com
Mon Mar 6 21:05:41 EST 2000


Gaetan Corneau <corg at copernic.com> writes:

> OK, I didn't make myself clear :)

Yes you have, at least for me.


> 1) *I* don't mind having to specify "self" in method definitions
> 
> 2) *I* don't mind having to write "self.Something"
> 
> 3) BUT I think that it would be *nice* not to have to specify "self" in
> method definitions, and it would certainly help A LOT of newbies
> 
> 4) if possible at all, not having to write "self.Something" would be cool,
> but not as important as #3
> 
> And don't tell me #3 can't (technically speaking) be done :)

Of course #3 can be done (technically speaking).  And in return for it
getting done, would you volunteer to donate your personal time to
change all the existing lines of Python code in the world that this
change would break?

Or barring that, would you be willing to pay for the time of all the
others who would have to do this work?


> If I'm mistaken, then OK, only C++ programmers forget to specify
> "self" as first parameter for a method, I won't insist, you know. If
> you really don't care about C++ programmers (but remember, there are
> quite a few), fine.

This is not an issue about "caring" about C++ programmers.  I am a C++
programmer, and literally hundreds of my colleagues over the past
decade or so have been C++ programmers.  Many of these people have
tried Python.  And *none* of them have ever even made a complaint
about the explicit "self" of Python.  You are the first C++ programmer
I have encountered who has ever raised this as an issue.  That's one
out of hundreds of people.

And as I have mentioned in another post, I challenge you to come up
any signficant number of people who would be glad to use Python if
only it didn't have an explicit "self".


> There could be other solutions even if you don't want to change
> things: why not emit a warning that you can turn off if you're an
> experienced Python programmer?

Because that warning won't keep the millions of lines of existing
Python code from breaking under your suggested new way of managing
"self".


> Is that clearer?  ;)

Your arguments have always been clear.  And they are still rather
unconvincing.


-- 
 Lloyd Zusman
 ljz at asfast.com



More information about the Python-list mailing list