Why self?

Robb Shecter rs at onsitetech.com
Tue Jul 9 17:19:58 EDT 2002


And, it according to consensus in this thread, this:

 >>
>>   self.y= self.x**2 * self.t/self.z + self.a * FFT(self.tseries)
>>

should really be written like this:

self.__y = self.__x**2 * self.__t/self.__z + self.__a * FFT(self.__tseries)

to be safe from accidental overwriting by subclasses.  Now there's a 
beauty!  :-)




More information about the Python-list mailing list