Deprecate self
Grant Edwards
grante at visi.com
Wed Apr 18 09:54:55 EDT 2001
In article <lc8zkyehug.fsf at gaffa.mit.edu>, Douglas Alan wrote:
>> Since self is used for every method of every class, isn't it a bit
>> redundant?
>
>Many people find it less confusing to read code that is written this
>way. Otherwise, when you see a variable, you have more choices as to
>where the variable might be defined: the local scope, the global
>scope, the class scope, etc.
>
>> I don't know of another OO language that makes you manually carry
>> around the "this"/"self" pointer/reference...
>
>Languages with multimethods routinely do, because multimethods are
>typically not class-centric. I.e., a generic function in a language
>with multimethods dispatches on all the arguments, not just on one of
>them, so no particular argument is given special treatment.
>
>For class-centric OO languages, I agree with you -- I don't personally
>know of any others that require explicit use of self.
Smalltalk and Modula-3 both do, IIRC.
--
Grant Edwards grante Yow! We just joined the
at civil hair patrol!
visi.com
More information about the Python-list
mailing list