Why 'self' ?
johnroth at ameritech.net
Wed Oct 31 18:55:24 CET 2001
"Schaefer, F." <fschaef at ces.clemson.edu> wrote in message
news:3BE04E7A.8E2CF101 at ces.clemson.edu...
> Hi all,
> It's been a while that I am working with Python and actually
> the only thing I really do not like about it is 'self' in the
> member function definitions as argument. If it
> has to be there anyway, it is totally redundant to write it.
> So, why is self there ?
You need to have some way to refer to the instance. Some
people don't like the word 'self', and abbreviate it to 's' or
some such. I suppose it's slightly clearer to have it in the
method definition than to simply have 'self' be a pre-defined
variable name in a method, but in any case, it's way too
late to change now.
More information about the Python-list