Although this has been answered before (in case you hadn't noticed, I'm
going through a backlog of mail in reverse order :-) I would like to add
that the way this works in Python, it's very unlikely that you will do
this accidentally, and it can be quite useful at times. Of course there's
nothing you can do against malicious use, but that's the case for all
dynamic languages...
>Also...I was also wondering about this business of "methods" having the
>same syntax as "functions" but with an extra beginning argument for self.
>Naively, I'd much rather have an argument list that matched what I was
>explicitly sending, and have "self" be a reserved word that doesn't need
>to be passed. Is it something you just get used to? Is it a feature? It
>looks like it might be a constant background annoyance both while calling
>methods and while converting code from functions to methods.
Believe me, you get used to it pretty quickly. When converting code
from functions to methods, you actually often *keep* the 'self' parameter,
since in situations where this happens the function usually takes some
object as its first parameter to operate on, and it's likely that this will
be 'self' in the method version! (Else why would you be converting to
a method in the first place :-) It's even the case that you don't need
to rename it to 'self', because any name will do in this slot...
>I have no wish to start a flame war. On the whole I am very impressed with
>Python. It has a simple, elegant syntax (and I'm an elegance freak), and
>generally seems well-designed, easy and pleasant to use, and well worth
>the minimal learning effort.
Thank you. You're welcome :-)
>Finally...if anyone knows of apple event support for Mac Python, please,
>please tell me. I want a small easy CGI language for Macintosh.
>AppleScript is dead slow (and has other problems), and the only
>alternative I can find is MacPerl (not terrible, but clearly not as
>pleasant as Python).
Yes, this exists, in a very rudimentary and undocumented form. Check out
the Demo/bgen/ae/ directory.
--Guido van Rossum <guido@CNRI.Reston.VA.US>
URL: http://www.cwi.nl/~guido/