Why self?

David LeBlanc whisper at oz.net
Fri Jul 5 22:28:52 EDT 2002


Yeah, some people need training wheels - others don't. Alas, some people get
dependent on their training wheels. Funnily enough, all the actual young
kids who where taught Smalltalk never seemed to miss not having to use self
for everything.

It's too bad that people who don't need crutches or who have outgrown them
are stuck with this misfeature.

David LeBlanc
Seattle, WA USA

> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of Courageous
> Sent: Friday, July 05, 2002 19:00
> To: python-list at python.org
> Subject: Re: Why self?
>
>
>
> >Did you know that for larger projects people like to use "this->name"
> >or prefix the member variables with 'm_' to introduce expliciteness
> >into c++?
>
> Indeed, explicit self in Python solves the age old question:
> "what should I call my method arguments for data that stands
>  for member attributes"? Ala,
>
> class C:
>
> 	i = 0
>
> 	def setit ( self, i ):
>
> 		self.i = i
>
> In other environments, you're stuck doing things like:
>
> 	m_i = i;
>
> or...
>
> 	i = i_arg;
>
> ... a clear sign of a struggle to resolve mishandled ambiguity.
>
> So, the question should be, why on earth _confuse_ everything with
> implicit this?
>
> It really doesn't help.
>
> C//
>
> --
> http://mail.python.org/mailman/listinfo/python-list






More information about the Python-list mailing list