Deprecate self

Fredrik Lundh fredrik at pythonware.com
Wed Apr 18 11:18:57 EDT 2001


Dave LeBlanc wrote:
> Since self is used for every method of every class, isn't it a bit
> redundant? I don't know of another OO language that makes you manually
> carry around the "this"/"self" pointer/reference...
>
> Of course being new around here, i'm unaware if this has been hissed
> over in depth previously :-)

http://www.python.org/doc/FAQ.html#6.7

    Q. Why must 'self' be declared and used explicitly in
    method definitions and calls?

    A. So, is your current programming language C++ or
    Java? :-) /.../ The idea was borrowed from Modula-3.
    It turns out to be very useful, for a variety of reasons
    /.../

Cheers /F





More information about the Python-list mailing list