"self" - a python wart or "feature"

Cere Davis cere at u.washington.edu
Mon Feb 17 00:16:13 EST 2003


Thanks but I'm having diffuculty understanding how this FAQ answers my 
question about requiring self as the first argument in a function.
I can appreciate clarity of scope for variables but it seems to me that 
requiring an extra argument in a function that is allready indented into 
the class
to be unnecessary.  From what little I know about Ruby, it does not 
require this for function declarations within a class.  

Manuel M. Garcia wrote:

>http://c2.com/cgi/wiki?SelfDotSyndrome
>
>I was wrong about Ruby.  It looks like only the compiled languages let
>you fully dispense with the 'self' and 'self'-work-alikes.
>
>I consider Python's use of 'self' to be consistent and explicit, so
>personally I am happiest with Python's way of doing things.
>
>Manuel
>  
>






More information about the Python-list mailing list